]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev/net: allow new link name as an altname before renaming happens
authorNick Rosbrook <nick.rosbrook@canonical.com>
Wed, 2 Nov 2022 15:05:01 +0000 (11:05 -0400)
committerNick Rosbrook <nick.rosbrook@canonical.com>
Thu, 15 Dec 2022 14:21:53 +0000 (09:21 -0500)
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.

src/udev/net/link-config.c

index 1fbfc58c0d2812b7d0bce5a3eb2490b84e979f04..25edb49d28a81584c0ae3707812f629f7d40e603 100644 (file)
@@ -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, &current_altnames);