summaryrefslogtreecommitdiffhomepage
path: root/interface-ip.c
diff options
context:
space:
mode:
Diffstat (limited to 'interface-ip.c')
-rw-r--r--interface-ip.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/interface-ip.c b/interface-ip.c
index 56f3c0c..8c46168 100644
--- a/interface-ip.c
+++ b/interface-ip.c
@@ -377,9 +377,12 @@ void interface_ip_set_enabled(struct interface_ip_settings *ip, bool enabled)
if (route->enabled == _enabled)
continue;
- if (_enabled)
+ if (_enabled) {
+ if (!(route->flags & DEVROUTE_METRIC))
+ route->metric = ip->iface->metric;
+
system_add_route(dev, route);
- else
+ } else
system_del_route(dev, route);
route->enabled = _enabled;
}