if ((cur = tb[ROUTE_METRIC]) != NULL) {
route->metric = blobmsg_get_u32(cur);
route->flags |= DEVROUTE_METRIC;
- }
+ } else
+ route->metric = iface->metric;
if ((cur = tb[ROUTE_MTU]) != NULL) {
route->mtu = blobmsg_get_u32(cur);
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)
if (system_add_route(dev, route_new))
route_new->failed = true;