netifd: Routing table parameter needs to be checked in route update
authorHans Dedecker <dedeckeh@gmail.com>
Tue, 19 Nov 2013 11:17:02 +0000 (12:17 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 8 Dec 2013 17:43:51 +0000 (18:43 +0100)
Routing table parameter needs to be checked in interface_update_proto_route; a route which
has an identical nexthop but a different routing table needs to be deleted and added in the
correct routing table.

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
interface-ip.c

index 4edae2e91771ce41ac618392225d6b1132f9a7bb..60b446c8d7e083d486838cb4b8ffaf2dc60b314f 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)
-               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)