]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
If we handle >1 static IPv6 address, test them all before running the script.
authorRoy Marples <roy@marples.name>
Sun, 14 Feb 2016 08:17:35 +0000 (08:17 +0000)
committerRoy Marples <roy@marples.name>
Sun, 14 Feb 2016 08:17:35 +0000 (08:17 +0000)
ipv6.c

diff --git a/ipv6.c b/ipv6.c
index ee4f275f919abcfe7c9c2b9a0159b634cb4e629a..09c25525139fa0620435f4dc9ff06e6978064572 100644 (file)
--- 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