summaryrefslogtreecommitdiffstats
path: root/ipv6.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2016-02-14 08:17:35 +0000
committerRoy Marples <roy@marples.name>2016-02-14 08:17:35 +0000
commit3e40f11df0808de63dd5f3463d7ce50c594a78cb (patch)
tree52f1fe67cf5a36a703247e7221bdf4233b4e1ec3 /ipv6.c
parent408fe75557cf974bae70d3cf4c10a63fc2b2da91 (diff)
downloaddhcpcd-3e40f11df0808de63dd5f3463d7ce50c594a78cb.tar.xz
If we handle >1 static IPv6 address, test them all before running the script.
Diffstat (limited to 'ipv6.c')
-rw-r--r--ipv6.c21
1 files changed, 20 insertions, 1 deletions
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