network: assume enslaved when master ifindex is positive

This commit is contained in:
Yu Watanabe
2021-09-04 00:20:36 +09:00
parent 571bf1aa31
commit 1f024462d1
+1 -7
View File
@@ -1689,17 +1689,11 @@ bool link_has_carrier(Link *link) {
static bool link_is_enslaved(Link *link) {
if (link->flags & IFF_SLAVE)
/* Even if the link is not managed by networkd, honor IFF_SLAVE flag. */
return true;
if (!link->network)
return false;
if (link->master_ifindex > 0 && link->network->bridge)
if (link->master_ifindex > 0)
return true;
/* TODO: add conditions for other netdevs. */
return false;
}