diff options
| author | Roy Marples <roy@marples.name> | 2016-05-19 09:15:46 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2016-05-19 09:15:46 +0000 |
| commit | 2eb2966f967ca0e70f7720fae31c1822fd7a615e (patch) | |
| tree | d02e8a46934fc2673354f5d5e3847e0d4e9425f2 | |
| parent | 0b51734a3b30955f5d0055831f83e13314d79dbd (diff) | |
| download | dhcpcd-2eb2966f967ca0e70f7720fae31c1822fd7a615e.tar.xz | |
Grab the state before freeing the address.
| -rw-r--r-- | ipv4.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -888,7 +888,6 @@ ipv4_buildroutes(struct dhcpcd_ctx *ctx) int ipv4_deladdr(struct ipv4_addr *addr, int keeparp) { - struct interface *ifp; int r; struct ipv4_state *state; struct ipv4_addr *ap; @@ -911,10 +910,10 @@ ipv4_deladdr(struct ipv4_addr *addr, int keeparp) if (IPV4_MASK_EQ(ap, addr)) { struct dhcp_state *dstate; + dstate = D_STATE(ap->iface); TAILQ_REMOVE(&state->addrs, ap, next); free(ap); - dstate = D_STATE(ifp); if (dstate && dstate->addr == ap) { dstate->added = 0; dstate->addr = NULL; |
