From: Roy Marples Date: Wed, 22 Jul 2015 10:11:44 +0000 (+0000) Subject: When ending IPv4LL, only rebuild routes if we dropped an address. X-Git-Tag: v6.9.2~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4445cd18d66baa1f217db6d6ece02ca787ffcdb2;p=thirdparty%2Fdhcpcd.git When ending IPv4LL, only rebuild routes if we dropped an address. --- diff --git a/ipv4ll.c b/ipv4ll.c index e610256a..1c84fe51 100644 --- a/ipv4ll.c +++ b/ipv4ll.c @@ -350,9 +350,11 @@ void ipv4ll_freedrop(struct interface *ifp, int drop) { struct ipv4ll_state *state; + int dropped; assert(ifp != NULL); state = IPV4LL_STATE(ifp); + dropped = 0; /* Free ARP state first because ipv4_deladdr might also ... */ if (state && state->arp) { @@ -363,9 +365,7 @@ 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; @@ -393,6 +393,7 @@ ipv4ll_freedrop(struct interface *ifp, int drop) free(state); ifp->if_data[IF_DATA_IPV4LL] = NULL; - ipv4_buildroutes(ifp->ctx); + if (dropped) + ipv4_buildroutes(ifp->ctx); } }