summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2012-05-20 00:42:21 +0200
committerFelix Fietkau <nbd@openwrt.org>2012-05-20 00:42:21 +0200
commit0079ac42fcff0e703467c188c37db902ee8cead8 (patch)
tree10438dd25d15f8cfbcecf2046c258a3469fd3188
parent4fd17ab96b3025a594e0e2ace35882573f571cb8 (diff)
pass interface route metric to routes when adding them
-rw-r--r--interface-ip.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/interface-ip.c b/interface-ip.c
index 3b545ca..b681b81 100644
--- a/interface-ip.c
+++ b/interface-ip.c
@@ -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);