Skip to content

Commit

Permalink
network: do not bring down a bonding port interface when it is alread…
Browse files Browse the repository at this point in the history
…y joined

Follow-up for 9f913d3.

Fixes #31165.
  • Loading branch information
yuwata committed Feb 9, 2024
1 parent a140eaf commit c3e12de
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/network/networkd-setlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
Expand Down

0 comments on commit c3e12de

Please sign in to comment.