summaryrefslogtreecommitdiffstats
path: root/if.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 /if.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 'if.c')
-rw-r--r--if.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/if.c b/if.c
index b79f01b1..6a311ef8 100644
--- a/if.c
+++ b/if.c
@@ -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);
}