{
struct device *dev = iface->l3_dev.dev;
struct device_route route;
+ bool v6 = ((addr->flags & DEVADDR_FAMILY) == DEVADDR_INET6);
if (addr->flags & DEVADDR_OFFLINK)
return;
route.flags &= ~DEVADDR_KERNEL;
route.metric = iface->metric;
+ route.table = (v6) ? iface->ip6table : iface->ip4table;
+ if (route.table)
+ route.flags |= DEVROUTE_SRCTABLE;
system_add_route(dev, &route);
} else {
system_del_route(dev, &route);
if (system_add_address(dev, a_new))
a_new->failed = true;
- if (iface->metric)
+ if (iface->metric || a_new->policy_table)
interface_handle_subnet_route(iface, a_new, true);
}