]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: tighten the condition whether link has carrier 12577/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 17 May 2019 00:14:59 +0000 (09:14 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 18 May 2019 20:39:45 +0000 (05:39 +0900)
ip command requires that IFF_RUNNING is set for that the link has
carrier.

src/network/networkd-link.c

index 6b4ed33932f04d15c45f0c72e48f4fe80db57115..ac123ddc1ebe9fc34499e6bc51fc7fc1b33460c1 100644 (file)
@@ -1637,7 +1637,8 @@ bool link_has_carrier(Link *link) {
 
         if (link->kernel_operstate == IF_OPER_UNKNOWN)
                 /* operstate may not be implemented, so fall back to flags */
-                if ((link->flags & IFF_LOWER_UP) && !(link->flags & IFF_DORMANT))
+                if (FLAGS_SET(link->flags, IFF_LOWER_UP | IFF_RUNNING) &&
+                    !FLAGS_SET(link->flags, IFF_DORMANT))
                         return true;
 
         return false;