]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix TEST for IPv4LL.
authorRoy Marples <roy@marples.name>
Sat, 19 Sep 2015 16:43:12 +0000 (16:43 +0000)
committerRoy Marples <roy@marples.name>
Sat, 19 Sep 2015 16:43:12 +0000 (16:43 +0000)
ipv4ll.c

index 9952360ed896e22ba2496852b5dd9befea7307f2..a1f103032ef74fdab7797071afb41d942db26e78 100644 (file)
--- a/ipv4ll.c
+++ b/ipv4ll.c
@@ -176,9 +176,12 @@ ipv4ll_probed(struct arp_state *astate)
 #endif
                logger(ifp->ctx, LOG_INFO, "%s: using IPv4LL address %s",
                  ifp->name, inet_ntoa(astate->addr));
-       if (ia == NULL)
+       if (ia == NULL) {
+               if (ifp->ctx->options & DHCPCD_TEST)
+                       goto test;
                ia = ipv4_addaddr(ifp, &astate->addr,
                    &inaddr_llmask, &inaddr_llbcast);
+       }
        if (ia == NULL)
                return;
 #ifdef IN_IFF_NOTREADY
@@ -187,7 +190,13 @@ ipv4ll_probed(struct arp_state *astate)
        logger(ifp->ctx, LOG_DEBUG, "%s: DAD completed for %s",
            ifp->name, inet_ntoa(astate->addr));
 #endif
+test:
        state->addr = astate->addr;
+       if (ifp->ctx->options & DHCPCD_TEST) {
+               script_runreason(ifp, "TEST");
+               eloop_exit(ifp->ctx->eloop, EXIT_SUCCESS);
+               return;
+       }
        timespecclear(&state->defend);
        if_initrt(ifp);
        ipv4_buildroutes(ifp->ctx);