diff options
author | Hans Dedecker <dedeckeh@gmail.com> | 2014-05-07 09:19:05 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2014-05-09 15:50:33 +0200 |
commit | 4ed03f2481cb2c687b0b38258e53c6be933c3918 (patch) | |
tree | 5b3b19d478bcbbfa8458ee7279623cef598b0f63 | |
parent | 38c29e0bccabca0956498814729b2177b27e48a9 (diff) |
netifd: Don't assume routes are always applied in all cases
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
-rw-r--r-- | interface-ip.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/interface-ip.c b/interface-ip.c index 018b657..8458666 100644 --- a/interface-ip.c +++ b/interface-ip.c @@ -622,8 +622,10 @@ interface_update_host_route(struct vlist_tree *tree, free(route_old); } - if (node_new) - system_add_route(dev, route_new); + if (node_new) { + if (system_add_route(dev, route_new)) + route_new->failed = true; + } } @@ -1140,7 +1142,8 @@ void interface_ip_set_enabled(struct interface_ip_settings *ip, bool enabled) if (!(route->flags & DEVROUTE_METRIC)) route->metric = ip->iface->metric; - system_add_route(dev, route); + if (system_add_route(dev, route)) + route->failed = true; } else system_del_route(dev, route); route->enabled = _enabled; |