mirror of
https://github.com/systemd/systemd.git
synced 2024-12-25 01:34:28 +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:
parent
3c3e14a7d8
commit
9f913d37a0
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user