network: do not bring down a bonding port interface when it is already joined
Follow-up for 9f913d37a0.
Fixes #31165.
This commit is contained in:
@@ -532,15 +532,6 @@ static int link_is_ready_to_set_link(Link *link, Request *req) {
|
||||
if (!netdev_is_ready(link->network->bond))
|
||||
return false;
|
||||
m = link->network->bond->ifindex;
|
||||
|
||||
/* Do not check link->set_flags_messages here, as it is ok even if link->flags
|
||||
* is outdated, and checking the counter causes a deadlock. */
|
||||
if (FLAGS_SET(link->flags, IFF_UP)) {
|
||||
/* link must be down when joining to bond master. */
|
||||
r = link_down_now(link);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
} else if (link->network->bridge) {
|
||||
if (ordered_set_contains(link->manager->request_queue, &req_mac))
|
||||
return false;
|
||||
@@ -559,6 +550,15 @@ static int link_is_ready_to_set_link(Link *link, Request *req) {
|
||||
return -EALREADY; /* indicate to cancel the request. */
|
||||
}
|
||||
|
||||
/* Do not check link->set_flags_messages here, as it is ok even if link->flags is outdated,
|
||||
* and checking the counter causes a deadlock. */
|
||||
if (link->network->bond && FLAGS_SET(link->flags, IFF_UP)) {
|
||||
/* link must be down when joining to bond master. */
|
||||
r = link_down_now(link);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
|
||||
req->userdata = UINT32_TO_PTR(m);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user