Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

network: skip to reassign master ifindex if already set #25162

Merged
merged 1 commit into from Oct 31, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/network/networkd-setlink.c
Expand Up @@ -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;
}
Expand All @@ -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;

Expand Down