]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
linux: fix wireless roaming
authorRoy Marples <roy@marples.name>
Fri, 21 Jul 2023 14:41:03 +0000 (15:41 +0100)
committerRoy Marples <roy@marples.name>
Tue, 22 Aug 2023 14:12:21 +0000 (15:12 +0100)
Fixes #228.

src/if-linux.c

index 5e033a160186fed461ba0c381c53cf0d921da1ee..cb3895360856173bc20dde71337b641fdd526fc6 100644 (file)
@@ -553,12 +553,14 @@ bool
 if_roaming(struct interface *ifp)
 {
 
-#ifdef IFF_LOWER_UP
        if (!ifp->wireless ||
-           ifp->flags & IFF_RUNNING ||
-           (ifp->flags & (IFF_UP | IFF_LOWER_UP)) != (IFF_UP | IFF_LOWER_UP))
+           ifp->flags & IFF_RUNNING)
                return false;
-       return true;
+
+#if defined(IFF_DORMANT)
+       return ifp->flags & IFF_DORMANT;
+#elif defined(IFF_LOWER_UP)
+       return (ifp->flags & (IFF_UP|IFF_LOWER_UP)) == (IFF_UP|IFF_LOWER_UP);
 #else
        return false;
 #endif