]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
If there is not IPv6 subnet route to delete, don't moan.
authorRoy Marples <roy@marples.name>
Fri, 12 Oct 2012 12:13:16 +0000 (12:13 +0000)
committerRoy Marples <roy@marples.name>
Fri, 12 Oct 2012 12:13:16 +0000 (12:13 +0000)
ipv6.c
ipv6rs.c

diff --git a/ipv6.c b/ipv6.c
index f542d54a5edf0aade808c03b5337410d1a19b38d..c57554edd7c5fd0efcbad6e13287be4948f1d979 100644 (file)
--- a/ipv6.c
+++ b/ipv6.c
@@ -352,7 +352,14 @@ ipv6_remove_subnet(struct ra *rap, struct ipv6_addr *addr)
 #else
                if (!find_route6(routes, rt))
 #endif
+               {
                        r = del_route6(rt);
+                       /* If the subnet route didn't exist, don't
+                        * moan about it.
+                        * We currently do this to silence FreeBSD-7 */
+                       if (r == -1 && errno == ESRCH)
+                               r = 0;
+               }
                free(rt);
        }
        return r;
index 57cbcf22dd1548fafd68d5bd85265564ba6eede0..a2c036bc86750c9ee9870262002f4c4bf68be24d 100644 (file)
--- a/ipv6rs.c
+++ b/ipv6rs.c
@@ -699,13 +699,14 @@ ipv6rs_handledata(_unused void *arg)
                            ifp->name, ap->saddr);
                        if (add_address6(ifp, ap) == -1)
                                syslog(LOG_ERR, "add_address6 %m");
-                       else if (ipv6_remove_subnet(rap, ap) == -1)
-                               syslog(LOG_ERR, "ipv6_remove_subnet %m");
-                       else
+                       else {
+                               if (ipv6_remove_subnet(rap, ap) == -1)
+                                       syslog(LOG_ERR,"ipv6_remove_subnet %m");
                                syslog(LOG_DEBUG,
                                    "%s: vltime %d seconds, pltime %d seconds",
                                    ifp->name, ap->prefix_vltime,
                                    ap->prefix_pltime);
+                       }
                }
        }
        if (!(options & DHCPCD_TEST))