summaryrefslogtreecommitdiffhomepage
path: root/system-linux.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2012-02-15 18:31:55 +0100
committerFelix Fietkau <nbd@openwrt.org>2012-02-15 18:31:55 +0100
commit13490ce99ab44afdf20a129fc9232682ed67b7ce (patch)
treeacbd70167b6dca8b7e7a0dc4328b54164946ca4b /system-linux.c
parentfb8c31126f5837d8d014f31083e97f32aa5063b2 (diff)
set route metrics using netlink
Diffstat (limited to 'system-linux.c')
-rw-r--r--system-linux.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/system-linux.c b/system-linux.c
index aa3aeda..7f825fa 100644
--- a/system-linux.c
+++ b/system-linux.c
@@ -891,6 +891,9 @@ static int system_rt(struct device *dev, struct device_route *route, int cmd)
if (route->mask)
nla_put(msg, RTA_DST, alen, &route->addr);
+ if (route->metric >= 0)
+ nla_put_u32(msg, RTA_PRIORITY, route->metric);
+
if (have_gw)
nla_put(msg, RTA_GATEWAY, alen, &route->nexthop);