From: Roy Marples Date: Sun, 14 Feb 2016 08:17:35 +0000 (+0000) Subject: If we handle >1 static IPv6 address, test them all before running the script. X-Git-Tag: v6.10.2~58 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e40f11df0808de63dd5f3463d7ce50c594a78cb;p=thirdparty%2Fdhcpcd.git If we handle >1 static IPv6 address, test them all before running the script. --- diff --git a/ipv6.c b/ipv6.c index ee4f275f..09c25525 100644 --- a/ipv6.c +++ b/ipv6.c @@ -1344,8 +1344,27 @@ ipv6_staticdadcallback(void *arg) else if (!wascompleted) { logger(ia->iface->ctx, LOG_DEBUG, "%s: IPv6 static DAD completed", ia->iface->name); - script_runreason(ia->iface, "STATIC6"); } + +#define FINISHED (IPV6_AF_ADDED | IPV6_AF_DADCOMPLETED) + if (!wascompleted) { + struct interface *ifp; + struct ipv6_state *state; + + ifp = ia->iface; + state = IPV6_STATE(ifp); + TAILQ_FOREACH(ia, &state->addrs, next) { + if (ia->flags & IPV6_AF_STATIC && + (ia->flags & FINISHED) != FINISHED) + { + wascompleted = 1; + break; + } + } + if (!wascompleted) + script_runreason(ifp, "STATIC6"); + } +#undef FINISHED } ssize_t