]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Log why we cannot delete a route
authorRoy Marples <roy@marples.name>
Thu, 13 Feb 2014 13:07:44 +0000 (13:07 +0000)
committerRoy Marples <roy@marples.name>
Thu, 13 Feb 2014 13:07:44 +0000 (13:07 +0000)
ipv4.c
ipv6.c

diff --git a/ipv4.c b/ipv4.c
index d6751cb5e3080475a4f0638f3c47d4796674b8fa..cffb043fc4de262535d5e7a78102449923144954 100644 (file)
--- 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 8cab5934190f78f4165e692605d27264beeae64a..bd3ca1ff4975ebe66d5e950701517043a40e4d70 100644 (file)
--- 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);