From: Roy Marples Date: Tue, 29 Nov 2016 16:25:37 +0000 (+0000) Subject: FreeBSD does not set an error when trying to get IPv6 address flags for a just depart... X-Git-Tag: v7.0.0-beta1~99 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f8997869fdff8698650ee9535481a7adda03ac63;p=thirdparty%2Fdhcpcd.git FreeBSD does not set an error when trying to get IPv6 address flags for a just departed interface. --- diff --git a/if-bsd.c b/if-bsd.c index 0e033d17..26c2b062 100644 --- 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; }