]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Run NOCARRIER before dropping protocols.
authorRoy Marples <roy@marples.name>
Wed, 7 May 2014 09:22:26 +0000 (09:22 +0000)
committerRoy Marples <roy@marples.name>
Wed, 7 May 2014 09:22:26 +0000 (09:22 +0000)
dhcpcd.c

index e378b2dc068a564a05c022213cd72b7cf9641b96..ac953463dc10b0d5c94a31ab758c63a546efe9b9 100644 (file)
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -502,6 +502,7 @@ dhcpcd_handlecarrier(struct dhcpcd_ctx *ctx, int carrier, unsigned int flags,
                        if (ifp->carrier == LINK_UP)
                                syslog(LOG_INFO, "%s: carrier lost", ifp->name);
                        ifp->carrier = LINK_DOWN;
+                       script_runreason(ifp, "NOCARRIER");
                        dhcp6_drop(ifp, "EXPIRE6");
                        ipv6nd_drop(ifp);
                        /* Don't blindly delete our knowledge of LL addresses.
@@ -510,7 +511,6 @@ dhcpcd_handlecarrier(struct dhcpcd_ctx *ctx, int carrier, unsigned int flags,
                         * do nothing. */
                        ipv6_free_ll_callbacks(ifp);
                        dhcp_drop(ifp, "EXPIRE");
-                       script_runreason(ifp, "NOCARRIER");
                }
        } else if (carrier == LINK_UP && ifp->flags & IFF_UP) {
                if (ifp->carrier != LINK_UP) {