set route metrics using netlink
[project/netifd.git] / system-linux.c
index aa3aeda..7f825fa 100644 (file)
@@ -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->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);
 
        if (have_gw)
                nla_put(msg, RTA_GATEWAY, alen, &route->nexthop);