summaryrefslogtreecommitdiffstats
path: root/src/if.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-09-22 13:09:03 +0100
committerRoy Marples <roy@marples.name>2020-09-22 13:09:03 +0100
commit0ede9e5419b798ae5ed183ca7da7986b8d4419bd (patch)
treeb009feff69e39b125f76f361174635b6e2877b14 /src/if.c
parent96bf083104435f38e06375fbaa094ab50626b5de (diff)
downloaddhcpcd-0ede9e5419b798ae5ed183ca7da7986b8d4419bd.tar.xz
BSD: Detect initial link state in ifa_data
Not all interfaces report media state to get the link state. However, link state is available from getifaddrs(3) ifa_data for AF_LINK addresses. Testing shows that link state is also sent correctly via route(4) messages for the same interface. This makes pppoe(4) interfaces more reliable on FreeBSD and OpenBSD.
Diffstat (limited to 'src/if.c')
-rw-r--r--src/if.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/if.c b/src/if.c
index d3c326a9..2907cc0e 100644
--- a/src/if.c
+++ b/src/if.c
@@ -684,7 +684,7 @@ if_discover(struct dhcpcd_ctx *ctx, struct ifaddrs **ifaddrs,
#endif
ifp->active = active;
- ifp->carrier = if_carrier(ifp);
+ ifp->carrier = if_carrier_ifadata(ifp, ifa->ifa_data);
TAILQ_INSERT_TAIL(ifs, ifp, next);
}