diff options
| author | Roy Marples <roy@marples.name> | 2014-05-16 15:03:28 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2014-05-16 15:03:28 +0000 |
| commit | 0b32a745d347429beb53ddfba9ec4596b0b2e8e2 (patch) | |
| tree | 45daa75ba968999d4b73afd6185cb76ed507fe73 /dhcpcd.c | |
| parent | 51ec4f3c447e0f1014d4e2f56210bdb76e89d41b (diff) | |
| download | dhcpcd-0b32a745d347429beb53ddfba9ec4596b0b2e8e2.tar.xz | |
Only remove the interface from the list once all callouts have been
completed.
Diffstat (limited to 'dhcpcd.c')
| -rw-r--r-- | dhcpcd.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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); } |
