]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
dhcpcd: Check carrier directly after a route socket overflow
authorRoy Marples <roy@marples.name>
Wed, 18 Sep 2019 12:59:03 +0000 (13:59 +0100)
committerRoy Marples <roy@marples.name>
Wed, 18 Sep 2019 12:59:03 +0000 (13:59 +0100)
Check carrier directly rather than using LINK_UNKNOWN as that
will be forced down for wireless cards.

src/dhcpcd.c

index f944d9e67998b948dadcec181161ca8e72feb8a0..e9b8a0234183857ce857ad95a4c822b7325b83a1 100644 (file)
@@ -1094,8 +1094,13 @@ static void
 dhcpcd_checkcarrier(void *arg)
 {
        struct interface *ifp = arg;
+       int carrier;
 
-       dhcpcd_handlecarrier(ifp->ctx, LINK_UNKNOWN, ifp->flags, ifp->name);
+       /* Check carrier here rather than setting LINK_UNKNOWN.
+        * This is because we force LINK_UNKNOWN as down for wireless which
+        * we do not want when dealing with a route socket overflow. */
+       carrier = if_carrier(ifp);
+       dhcpcd_handlecarrier(ifp->ctx, carrier, ifp->flags, ifp->name);
 }
 
 #ifndef SMALL