From: Roy Marples Date: Thu, 19 May 2016 09:15:46 +0000 (+0000) Subject: Grab the state before freeing the address. X-Git-Tag: v6.11.1~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2eb2966f967ca0e70f7720fae31c1822fd7a615e;p=thirdparty%2Fdhcpcd.git Grab the state before freeing the address. --- diff --git a/ipv4.c b/ipv4.c index 2e71278c..844c84b7 100644 --- a/ipv4.c +++ b/ipv4.c @@ -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;