]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
BSD: LINK_UNKNOWN is traditionally treated as LINK_UP
authorRoy Marples <roy@marples.name>
Fri, 16 Oct 2020 13:36:34 +0000 (14:36 +0100)
committerRoy Marples <roy@marples.name>
Fri, 16 Oct 2020 13:36:34 +0000 (14:36 +0100)
src/if.c

index 5f4edb86d07da110572da96c798b86228e6b27b5..deb5280b34149c0ef9ef6ea30e79b344bca20ae1 100644 (file)
--- a/src/if.c
+++ b/src/if.c
@@ -198,10 +198,8 @@ if_is_link_up(const struct interface *ifp)
 {
 
        return ifp->flags & IFF_UP &&
-           (ifp->carrier == LINK_UP ||
-            (ifp->carrier == LINK_UNKNOWN &&
-             !(ifp->options == NULL ||
-               ifp->options->options & DHCPCD_LINK)));
+           (ifp->carrier != LINK_DOWN ||
+            (ifp->options != NULL && !(ifp->options->options & DHCPCD_LINK)));
 }
 
 int