summaryrefslogtreecommitdiffstats
path: root/dhcpcd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2016-07-28 13:10:20 +0000
committerRoy Marples <roy@marples.name>2016-07-28 13:10:20 +0000
commit95fae65a9aad74181edaf925f36f6cd18d302a71 (patch)
treeefa59402139df77bacdfa74e63d6da9b1f993e14 /dhcpcd.c
parent19c4848cd108eae50444a013083f32a15f6e03ac (diff)
downloaddhcpcd-95fae65a9aad74181edaf925f36f6cd18d302a71.tar.xz
When deactivating an interface, set the carrier to unknown as it's no longer being tracked.
Thanks to Koichi Okamoto.
Diffstat (limited to 'dhcpcd.c')
-rw-r--r--dhcpcd.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/dhcpcd.c b/dhcpcd.c
index db994765..1f3a9711 100644
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -397,6 +397,8 @@ stop_interface(struct interface *ifp)
/* De-activate the interface */
ifp->active = IF_INACTIVE;
ifp->options->options &= ~DHCPCD_STOPPING;
+ /* Set the link state to unknown as we're no longer tracking it. */
+ ifp->carrier = LINK_UNKNOWN;
stop:
if (!(ctx->options & (DHCPCD_MASTER | DHCPCD_TEST)))
@@ -1047,8 +1049,10 @@ dhcpcd_handleinterface(void *arg, int action, const char *ifname)
for (i = 0; i < ctx->ifc; i++)
if (strcmp(ctx->ifv[i], ifname) == 0)
break;
- if (i >= ctx->ifc)
+ if (i >= ctx->ifc) {
ifp->active = IF_INACTIVE;
+ ifp->carrier = LINK_UNKNOWN;
+ }
}
i = 0;