You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.5 KiB
38 lines
1.5 KiB
7 months ago
|
From 57d5e48a572b98d6ab978072daddac2f7faf8dc8 Mon Sep 17 00:00:00 2001
|
||
|
From: Nick Rosbrook <nick.rosbrook@canonical.com>
|
||
|
Date: Wed, 2 Nov 2022 11:05:01 -0400
|
||
|
Subject: [PATCH] udev/net: allow new link name as an altname before renaming
|
||
|
happens
|
||
|
|
||
|
When configuring a link's alternative names, the link's new name to-be
|
||
|
is not allowed to be included because interface renaming will fail if
|
||
|
the new name is already present as an alternative name. However,
|
||
|
rtnl_set_link_name will delete the conflicting alternative name before
|
||
|
renaming the device, if necessary.
|
||
|
|
||
|
Allow the new link name to be set as an alternative name before the
|
||
|
device is renamed. This means that if the rename is later skipped (i.e.
|
||
|
because the link is already up), then the name can at least still be
|
||
|
present as an alternative name.
|
||
|
|
||
|
(cherry picked from commit d0b31efc1ab7f6826ad834cf6b9e371bf73776aa)
|
||
|
|
||
|
Related: RHEL-5988
|
||
|
---
|
||
|
src/udev/net/link-config.c | 2 --
|
||
|
1 file changed, 2 deletions(-)
|
||
|
|
||
|
diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c
|
||
|
index e408725b08..5d28526527 100644
|
||
|
--- a/src/udev/net/link-config.c
|
||
|
+++ b/src/udev/net/link-config.c
|
||
|
@@ -841,8 +841,6 @@ static int link_apply_alternative_names(Link *link, sd_netlink **rtnl) {
|
||
|
}
|
||
|
}
|
||
|
|
||
|
- if (link->new_name)
|
||
|
- strv_remove(altnames, link->new_name);
|
||
|
strv_remove(altnames, link->ifname);
|
||
|
|
||
|
r = rtnl_get_link_alternative_names(rtnl, link->ifindex, ¤t_altnames);
|