From: Roy Marples Date: Fri, 16 May 2014 15:03:28 +0000 (+0000) Subject: Only remove the interface from the list once all callouts have been X-Git-Tag: v6.4.0~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b32a745d347429beb53ddfba9ec4596b0b2e8e2;p=thirdparty%2Fdhcpcd.git Only remove the interface from the list once all callouts have been completed. --- diff --git a/dhcpcd.c b/dhcpcd.c index ac953463..fe869c11 100644 --- a/dhcpcd.c +++ b/dhcpcd.c @@ -301,8 +301,6 @@ stop_interface(struct interface *ifp) syslog(LOG_INFO, "%s: removing interface", ifp->name); ifp->options->options |= DHCPCD_STOPPING; - // Remove the interface from our list - TAILQ_REMOVE(ifp->ctx->ifaces, ifp, next); dhcp6_drop(ifp, NULL); ipv6nd_drop(ifp); dhcp_drop(ifp, "STOP"); @@ -311,7 +309,11 @@ stop_interface(struct interface *ifp) script_runreason(ifp, "DEPARTED"); else script_runreason(ifp, "STOPPED"); + + // Remove the interface from our list + TAILQ_REMOVE(ifp->ctx->ifaces, ifp, next); if_free(ifp); + if (!(ctx->options & (DHCPCD_MASTER | DHCPCD_TEST))) eloop_exit(ctx->eloop, EXIT_FAILURE); }