From: Nick Rosbrook Date: Wed, 2 Nov 2022 15:05:01 +0000 (-0400) Subject: udev/net: allow new link name as an altname before renaming happens X-Git-Tag: v253-rc1~251^2~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d0b31efc1ab7f6826ad834cf6b9e371bf73776aa;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c index 1fbfc58c0d2..25edb49d28a 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);