kernel-pfroute: Don't set a gateway if it is of a different address family than the destination

This commit is contained in:
Tobias Brunner
2017-01-25 17:29:44 +01:00
parent 896d729a60
commit da565d9832
@@ -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);
}