]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev/net: generate new network interface name only on add uevent
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 16 May 2023 04:05:09 +0000 (13:05 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 16 May 2023 07:37:31 +0000 (16:37 +0900)
On other uevents, the name will be anyway ignored in rename_netif() in
udev-event.c.

src/udev/net/link-config.c

index e5f1220928cfdae6febaa0291f4f5348f15aedb2..28571319fcabd5d2fa57b12eecf28ee0cd6ee4df 100644 (file)
@@ -724,7 +724,7 @@ static int link_generate_new_name(Link *link) {
         config = link->config;
         device = link->device;
 
-        if (link->action == SD_DEVICE_MOVE) {
+        if (link->action != SD_DEVICE_ADD) {
                 log_link_debug(link, "Skipping to apply Name= and NamePolicy= on '%s' uevent.",
                                device_action_to_string(link->action));
                 goto no_rename;