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

index 30cf44afcbbc146e0c232c498f5af328bccd19ab..099050876b23cec86b232adc39c9f071ac562123 100644 (file)
@@ -689,16 +689,15 @@ bool link_relevant(Link *l, int family, bool local_multicast) {
          * A link is relevant for non-multicast traffic if it isn't a loopback device, has a link beat, and has at
          * least one routable address. */
 
-        if (l->flags & (IFF_LOOPBACK|IFF_DORMANT))
+        if ((l->flags & (IFF_LOOPBACK | IFF_DORMANT)) != 0)
                 return false;
 
-        if ((l->flags & (IFF_UP|IFF_LOWER_UP)) != (IFF_UP|IFF_LOWER_UP))
+        if (!FLAGS_SET(l->flags, IFF_UP | IFF_LOWER_UP))
                 return false;
 
-        if (local_multicast) {
-                if ((l->flags & IFF_MULTICAST) != IFF_MULTICAST)
-                        return false;
-        }
+        if (local_multicast &&
+            !FLAGS_SET(l->flags, IFF_MULTICAST))
+                return false;
 
         if (!netif_has_carrier(l->operstate, l->flags))
                 return false;