diff options
| author | Roy Marples <roy@marples.name> | 2020-06-18 21:15:15 +0100 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2020-06-18 21:15:15 +0100 |
| commit | 009dc39be56be9b2fae857e64aa55c20f2842d13 (patch) | |
| tree | 6085381f2e63161a8aa72f49eaac34f255f970be /src/if-bsd.c | |
| parent | 3f9355273c90c21bb1fdaa8bac9776f8195301b2 (diff) | |
| download | dhcpcd-009dc39be56be9b2fae857e64aa55c20f2842d13.tar.xz | |
dhcpcd: Add an option to poll the interface carrier state
Only to be used if the interface does not report carrier state
changes for whatever reason.
Diffstat (limited to 'src/if-bsd.c')
| -rw-r--r-- | src/if-bsd.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/if-bsd.c b/src/if-bsd.c index 090b587b..5e748a4e 100644 --- a/src/if-bsd.c +++ b/src/if-bsd.c @@ -358,6 +358,10 @@ if_carrier(struct interface *ifp) { struct ifmediareq ifmr = { .ifm_status = 0 }; + /* Not really needed, but the other OS update flags here also */ + if (if_getflags(ifp) == -1) + return LINK_UNKNOWN; + strlcpy(ifmr.ifm_name, ifp->name, sizeof(ifmr.ifm_name)); if (ioctl(ifp->ctx->pf_inet_fd, SIOCGIFMEDIA, &ifmr) == -1 || !(ifmr.ifm_status & IFM_AVALID)) |
