From 13490ce99ab44afdf20a129fc9232682ed67b7ce Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 15 Feb 2012 18:31:55 +0100 Subject: [PATCH] set route metrics using netlink --- system-linux.c | 3 +++ 1 file changed, 3 insertions(+) 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); -- 2.30.2