1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-23 21:35:11 +03:00

network: skip to reassign master ifindex if already set

Otherwise, the slave interface may go down, especially when the master
is bond.

Fixes #25067.
This commit is contained in:
Yu Watanabe 2022-10-28 06:40:07 +09:00 committed by Luca Boccassi
parent 3c3e14a7d8
commit 9f913d37a0

View File

@ -543,6 +543,12 @@ static int link_is_ready_to_set_link(Link *link, Request *req) {
m = link->network->vrf->ifindex;
}
if (m == (uint32_t) link->master_ifindex) {
/* The requested master is already set. */
link->master_set = true;
return -EALREADY; /* indicate to cancel the request. */
}
req->userdata = UINT32_TO_PTR(m);
break;
}
@ -568,6 +574,8 @@ static int link_process_set_link(Request *req, Link *link, void *userdata) {
assert(link);
r = link_is_ready_to_set_link(link, req);
if (r == -EALREADY)
return 1; /* Cancel the request. */
if (r <= 0)
return r;