]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev-event: set INTERFACE/INTERFACE_OLD property on rename only when the device is...
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 5 Mar 2025 23:19:45 +0000 (08:19 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 12 Mar 2025 16:08:57 +0000 (01:08 +0900)
This does not change any behavior, as currently udevd only supports
renaming for network interfaces.

Closes #26156.

src/udev/udev-event.c

index 7d9153061f7ba0a80ee4ed2211cced4ebd0dc4d7..9a50acafe96c4ba65d42c96e6096bd8dd3a0a59f 100644 (file)
@@ -96,11 +96,8 @@ static int device_rename(sd_device *device, const char *name) {
         if (r < 0)
                 return r;
 
-        r = sd_device_get_property_value(device, "INTERFACE", &s);
-        if (r == -ENOENT)
+        if (device_get_ifname(device, &s) < 0)
                 return 0;
-        if (r < 0)
-                return r;
 
         /* like DEVPATH_OLD, INTERFACE_OLD is not saved to the db, but only stays around for the current event */
         r = device_add_property_internal(device, "INTERFACE_OLD", s);