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 2016-10-07 12:12:15 +02:00
parent 896d729a60
commit da565d9832
1 changed files with 2 additions and 1 deletions

View 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);
}