From: Roy Marples Date: Thu, 9 Jul 2015 13:51:26 +0000 (+0000) Subject: Only run the IPv4LL script on drop when actually dropping an IPv4LL address. X-Git-Tag: v6.9.2~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=957500a4cc445ecf260469e64a3ae71ea09f5cce;p=thirdparty%2Fdhcpcd.git Only run the IPv4LL script on drop when actually dropping an IPv4LL address. --- diff --git a/ipv4ll.c b/ipv4ll.c index 87e598bf..e610256a 100644 --- a/ipv4ll.c +++ b/ipv4ll.c @@ -363,10 +363,13 @@ ipv4ll_freedrop(struct interface *ifp, int drop) if (drop && (ifp->options->options & DHCPCD_NODROP) != DHCPCD_NODROP) { struct ipv4_state *istate; + int dropped; + dropped = 0; if (state && state->addr.s_addr != INADDR_ANY) { ipv4_deladdr(ifp, &state->addr, &inaddr_llmask, 1); state->addr.s_addr = INADDR_ANY; + dropped = 1; } /* Free any other link local addresses that might exist. */ @@ -374,12 +377,16 @@ ipv4ll_freedrop(struct interface *ifp, int drop) struct ipv4_addr *ia, *ian; TAILQ_FOREACH_SAFE(ia, &istate->addrs, next, ian) { - if (IN_LINKLOCAL(ntohl(ia->addr.s_addr))) + if (IN_LINKLOCAL(ntohl(ia->addr.s_addr))) { ipv4_deladdr(ifp, &ia->addr, &ia->net, 0); + dropped = 1; + } } } - script_runreason(ifp, "IPV4LL"); + + if (dropped) + script_runreason(ifp, "IPV4LL"); } if (state) {