resolve: use FLAGS_SET() macro

This commit is contained in:
Yu Watanabe
2022-01-21 06:22:16 +09:00
parent 12f45cbbbe
commit e9662a28a4
+5 -6
View 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;