]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Only stop the interface if it's active when the interface departs.
authorRoy Marples <roy@marples.name>
Mon, 11 Jan 2016 14:02:01 +0000 (14:02 +0000)
committerRoy Marples <roy@marples.name>
Mon, 11 Jan 2016 14:02:01 +0000 (14:02 +0000)
Fixes [97eb3351d3].

dhcpcd.c

index e9e78e4143ef401561a6947eda8a6f2e35619ba3..f7c6d8b61de529b1953e14e4e5913422d44ba774 100644 (file)
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -1020,11 +1020,12 @@ dhcpcd_handleinterface(void *arg, int action, const char *ifname)
                        errno = ESRCH;
                        return -1;
                }
-               if (ifp->active)
+               if (ifp->active) {
                        logger(ctx, LOG_DEBUG, "%s: interface departed",
                            ifp->name);
-               ifp->options->options |= DHCPCD_DEPARTED;
-               stop_interface(ifp);
+                       ifp->options->options |= DHCPCD_DEPARTED;
+                       stop_interface(ifp);
+               }
                TAILQ_REMOVE(ctx->ifaces, ifp, next);
                if_free(ifp);
                return 0;