From: Tobias Brunner Date: Fri, 7 Oct 2016 10:12:15 +0000 (+0200) Subject: kernel-pfroute: Don't set a gateway if it is of a different address family than the... X-Git-Tag: 5.5.2dr5~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da565d983298c89fd5df277b23a820964380b332;p=thirdparty%2Fstrongswan.git kernel-pfroute: Don't set a gateway if it is of a different address family than the destination --- diff --git a/src/libcharon/plugins/kernel_pfroute/kernel_pfroute_net.c b/src/libcharon/plugins/kernel_pfroute/kernel_pfroute_net.c index 236e3417f9..0717a8a2ef 100644 --- a/src/libcharon/plugins/kernel_pfroute/kernel_pfroute_net.c +++ b/src/libcharon/plugins/kernel_pfroute/kernel_pfroute_net.c @@ -1448,7 +1448,8 @@ static status_t manage_route(private_kernel_pfroute_net_t *this, int op, } break; case RTAX_GATEWAY: - if (gateway) + if (gateway && + gateway->get_family(gateway) == dst->get_family(dst)) { add_rt_addr(&msg.hdr, RTA_GATEWAY, gateway); }