]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolve: use netif_has_carrier()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 20 Jan 2022 20:05:04 +0000 (05:05 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 20 Jan 2022 20:07:10 +0000 (05:07 +0900)
src/resolve/resolved-link.c

index 344329f18990cad132ecff26cf5806c2ae149a55..30cf44afcbbc146e0c232c498f5af328bccd19ab 100644 (file)
@@ -11,6 +11,7 @@
 #include "fileio.h"
 #include "log-link.h"
 #include "mkdir.h"
+#include "netif-util.h"
 #include "parse-util.h"
 #include "resolved-link.h"
 #include "resolved-llmnr.h"
@@ -699,9 +700,7 @@ bool link_relevant(Link *l, int family, bool local_multicast) {
                         return false;
         }
 
-        /* Check kernel operstate
-         * https://www.kernel.org/doc/Documentation/networking/operstates.txt */
-        if (!IN_SET(l->operstate, IF_OPER_UNKNOWN, IF_OPER_UP))
+        if (!netif_has_carrier(l->operstate, l->flags))
                 return false;
 
         (void) sd_network_link_get_operational_state(l->ifindex, &state);