From: Roy Marples Date: Thu, 13 Feb 2014 13:07:44 +0000 (+0000) Subject: Log why we cannot delete a route X-Git-Tag: v6.3.0~10 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bb0f6a5e5860f4f49e6cb7478fa16f2230f21225;p=thirdparty%2Fdhcpcd.git Log why we cannot delete a route --- diff --git a/ipv4.c b/ipv4.c index d6751cb5..cffb043f 100644 --- a/ipv4.c +++ b/ipv4.c @@ -259,7 +259,8 @@ nc_route(int add, struct rt *ort, struct rt *nrt) * prefer the interface. * This also has the nice side effect of flushing ARP entries so * we don't have to do that manually. */ - ipv4_deleteroute(ort); + if (ipv4_deleteroute(ort) == -1 && errno != ESRCH) + syslog(LOG_ERR, "%s: ipv4_deleteroute: %m", ort->iface->name); if (!ipv4_addroute(nrt)) return 0; syslog(LOG_ERR, "%s: ipv4_addroute: %m", nrt->iface->name); diff --git a/ipv6.c b/ipv6.c index 8cab5934..bd3ca1ff 100644 --- a/ipv6.c +++ b/ipv6.c @@ -805,7 +805,8 @@ nc_route(int add, struct rt6 *ort, struct rt6 *nrt) desc_route(add ? "adding" : "changing", nrt); /* We delete and add the route so that we can change metric and * prefer the interface. */ - del_route6(ort); + if (del_route6(ort) == -1 && errno != ESRCH) + syslog(LOG_ERR, "%s: del_route6: %m", ort->iface->name); if (add_route6(nrt) == 0) return 0; syslog(LOG_ERR, "%s: add_route6: %m", nrt->iface->name);