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 /if.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 'if.c')
| -rw-r--r-- | if.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -346,7 +346,6 @@ if_discover(struct dhcpcd_ctx *ctx, int argc, char * const *argv) ifp->ctx = ctx; strlcpy(ifp->name, spec.devname, sizeof(ifp->name)); ifp->flags = ifa->ifa_flags; - ifp->carrier = if_carrier(ifp); if (ifa->ifa_addr != NULL) { #ifdef AF_LINK @@ -516,6 +515,10 @@ if_discover(struct dhcpcd_ctx *ctx, int argc, char * const *argv) #endif ifp->active = active; + if (ifp->active) + ifp->carrier = if_carrier(ifp); + else + ifp->carrier = LINK_UNKNOWN; TAILQ_INSERT_TAIL(ifs, ifp, next); } |
