From 4ed03f2481cb2c687b0b38258e53c6be933c3918 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Wed, 7 May 2014 09:19:05 +0000 Subject: [PATCH] netifd: Don't assume routes are always applied in all cases Signed-off-by: Hans Dedecker --- interface-ip.c | 9 ++++++--- 1 file 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; -- 2.25.1