pass interface route metric to routes when adding them
authorFelix Fietkau <nbd@openwrt.org>
Sat, 19 May 2012 22:42:21 +0000 (00:42 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Sat, 19 May 2012 22:42:21 +0000 (00:42 +0200)
interface-ip.c

index 3b545ca1dfec2db4c520b6e3b2323e374140540f..b681b817e3787700bc98d59096bd94c64250e2ee 100644 (file)
@@ -337,6 +337,9 @@ interface_update_proto_route(struct vlist_tree *tree,
        if (node_new) {
                bool _enabled = enable_route(ip, route_new);
 
+               if (!(route_new->flags & DEVROUTE_METRIC))
+                       route_new->metric = iface->metric;
+
                if (!(route_new->flags & DEVADDR_EXTERNAL) && !keep && _enabled)
                        system_add_route(dev, route_new);