aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2016-10-07 12:12:15 +0200
committerTobias Brunner <tobias@strongswan.org>2017-01-25 17:29:44 +0100
commitda565d983298c89fd5df277b23a820964380b332 (patch)
tree0f892f59d0a123580e3fda79141147a5ad12d857 /src/libcharon
parent896d729a6057c2f4fe4a74bbc4c942a939f27a7e (diff)
downloadstrongswan-da565d983298c89fd5df277b23a820964380b332.tar.bz2
strongswan-da565d983298c89fd5df277b23a820964380b332.tar.xz
kernel-pfroute: Don't set a gateway if it is of a different address family than the destination
Diffstat (limited to 'src/libcharon')
-rw-r--r--src/libcharon/plugins/kernel_pfroute/kernel_pfroute_net.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libcharon/plugins/kernel_pfroute/kernel_pfroute_net.c b/src/libcharon/plugins/kernel_pfroute/kernel_pfroute_net.c
index 236e3417f..0717a8a2e 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);
}