diff options
| author | Roy Marples <roy@marples.name> | 2016-07-28 13:10:20 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2016-07-28 13:10:20 +0000 |
| commit | 95fae65a9aad74181edaf925f36f6cd18d302a71 (patch) | |
| tree | efa59402139df77bacdfa74e63d6da9b1f993e14 /dhcpcd.c | |
| parent | 19c4848cd108eae50444a013083f32a15f6e03ac (diff) | |
| download | dhcpcd-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.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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; |
