]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
When binding a non IPv4LL address, kill the IPV4LL state.
authorRoy Marples <roy@marples.name>
Fri, 24 Oct 2014 19:25:04 +0000 (19:25 +0000)
committerRoy Marples <roy@marples.name>
Fri, 24 Oct 2014 19:25:04 +0000 (19:25 +0000)
arp.c
dhcp.c

diff --git a/arp.c b/arp.c
index 0db52c14d5cc964ffec837420c2d330a4d00e24f..f4f644798ffb771a759051c62ea9dbf8479e99b6 100644 (file)
--- a/arp.c
+++ b/arp.c
@@ -313,9 +313,11 @@ arp_free(struct arp_state *astate)
 {
        struct dhcp_state *state;
 
-       state = D_STATE(astate->iface);
-       TAILQ_REMOVE(&state->arp_states, astate, next);
-       free(astate);
+       if (astate) {
+               state = D_STATE(astate->iface);
+               TAILQ_REMOVE(&state->arp_states, astate, next);
+               free(astate);
+       }
 }
 
 void
diff --git a/dhcp.c b/dhcp.c
index 9cbd8bf020e342cacaf235aae3e583f08c4bedb8..d2346108046a8bec5e178519b11339dc19336dfe 100644 (file)
--- a/dhcp.c
+++ b/dhcp.c
@@ -1970,8 +1970,13 @@ applyaddr:
                                astate->announced_cb =
                                    dhcp_arp_announced;
                        }
-                       if (astate)
+                       if (astate) {
                                arp_announce(astate);
+                               if (astate != state->arp_ipv4ll) {
+                                       arp_free(state->arp_ipv4ll);
+                                       state->arp_ipv4ll = NULL;
+                               }
+                       }
                } else if (!ipv4ll)
                        arp_close(ifp);
        }