From: Roy Marples Date: Sat, 19 Sep 2015 16:43:12 +0000 (+0000) Subject: Fix TEST for IPv4LL. X-Git-Tag: v6.9.4~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7db1547f3fecbb91841538b824ce8e30bc9cac23;p=thirdparty%2Fdhcpcd.git Fix TEST for IPv4LL. --- diff --git a/ipv4ll.c b/ipv4ll.c index 9952360e..a1f10303 100644 --- 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);