network: tighten the condition whether link has carrier

ip command requires that IFF_RUNNING is set for that the link has
carrier.
This commit is contained in:
Yu Watanabe
2019-05-17 09:14:59 +09:00
parent 2700d2c7dc
commit b26ea30801

View 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;