From: Martin Willi Date: Fri, 19 Apr 2013 10:17:25 +0000 (+0200) Subject: kernel-pfroute: split /0 routes to avoid conflict with default route X-Git-Tag: 5.1.0dr1~153^2~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=121783035cbc35c715beff92e28aa6d86d4cab70;p=thirdparty%2Fstrongswan.git kernel-pfroute: split /0 routes to avoid conflict with default route --- diff --git a/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c b/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c index 2fda4aebb7..f8d3f2c44c 100644 --- a/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c +++ b/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c @@ -897,6 +897,21 @@ static status_t manage_route(private_kernel_pfroute_net_t *this, int op, host_t *dst; int type; + if (prefixlen == 0 && dst_net.len) + { + status_t status; + chunk_t half; + + half = chunk_clonea(dst_net); + half.ptr[0] |= 0x80; + prefixlen = 1; + status = manage_route(this, op, half, prefixlen, gateway, if_name); + if (status != SUCCESS) + { + return status; + } + } + dst = host_create_from_chunk(AF_UNSPEC, dst_net, 0); if (!dst) {