]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
When ending IPv4LL, only rebuild routes if we dropped an address.
authorRoy Marples <roy@marples.name>
Wed, 22 Jul 2015 10:11:44 +0000 (10:11 +0000)
committerRoy Marples <roy@marples.name>
Wed, 22 Jul 2015 10:11:44 +0000 (10:11 +0000)
ipv4ll.c

index e610256a8450a4b4b88ee82ff890eee7d027282e..1c84fe51762d4211294c09ea4a51e4975b63fe4b 100644 (file)
--- 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);
        }
 }