kernel-pfroute: Don't set a gateway if it is of a different address family than the...
authorTobias Brunner <tobias@strongswan.org>
Fri, 7 Oct 2016 10:12:15 +0000 (12:12 +0200)
committerTobias Brunner <tobias@strongswan.org>
Wed, 25 Jan 2017 16:29:44 +0000 (17:29 +0100)
src/libcharon/plugins/kernel_pfroute/kernel_pfroute_net.c

index 236e341..0717a8a 100644 (file)
@@ -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);
                                }