]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
FreeBSD does not set an error when trying to get IPv6 address flags for a just depart...
authorRoy Marples <roy@marples.name>
Tue, 29 Nov 2016 16:25:37 +0000 (16:25 +0000)
committerRoy Marples <roy@marples.name>
Tue, 29 Nov 2016 16:25:37 +0000 (16:25 +0000)
if-bsd.c

index 0e033d1793478adeca21b52b9732d1f8fcb75529..26c2b062695279d6ef1590547c774da16fc502fa 100644 (file)
--- a/if-bsd.c
+++ b/if-bsd.c
@@ -1235,9 +1235,15 @@ if_ifa(struct dhcpcd_ctx *ctx, const struct ifa_msghdr *ifam)
                if (ifam->ifam_type == RTM_DELADDR ||
                    (addrflags = if_addrflags6(ifp, &addr6, NULL)) == -1)
                {
-                       if (ifam->ifam_type != RTM_DELADDR || errno != EEXIST)
+#ifdef __FreeBSD__
+                       /* For some reason FreeBSD does't set errno
+                        * if the interface has just departed. */
+                       errno = 0;
+#endif
+                       if (ifam->ifam_type != RTM_DELADDR ||
+                           (errno != EEXIST && errno != 0))
                                logger(ctx, LOG_ERR,
-                                   "%s: if_addrflags: %m",
+                                   "%s: if_addrflags6: %m",
                                    ifp->name);
                        addrflags = 0;
                }