netifd: Routing table parameter needs to be checked in route update
[project/netifd.git] / interface-ip.c
index 4edae2e..60b446c 100644 (file)
@@ -633,7 +633,8 @@ interface_update_proto_route(struct vlist_tree *tree,
        route_new = container_of(node_new, struct device_route, node);
 
        if (node_old && node_new)
        route_new = container_of(node_new, struct device_route, node);
 
        if (node_old && node_new)
-               keep = !memcmp(&route_old->nexthop, &route_new->nexthop, sizeof(route_old->nexthop));
+               keep = !memcmp(&route_old->nexthop, &route_new->nexthop, sizeof(route_old->nexthop)) &&
+                       (route_old->table == route_new->table);
 
        if (node_old) {
                if (!(route_old->flags & DEVADDR_EXTERNAL) && route_old->enabled && !keep)
 
        if (node_old) {
                if (!(route_old->flags & DEVADDR_EXTERNAL) && route_old->enabled && !keep)