From 4352457a9697da0466c03915aa10bc64ee4a328b Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 6 Mar 2025 08:19:45 +0900 Subject: [PATCH] udev-event: set INTERFACE/INTERFACE_OLD property on rename only when the device is a network interface This does not change any behavior, as currently udevd only supports renaming for network interfaces. Closes #26156. --- src/udev/udev-event.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/udev/udev-event.c b/src/udev/udev-event.c index 7d9153061f7..9a50acafe96 100644 --- a/src/udev/udev-event.c +++ b/src/udev/udev-event.c @@ -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); -- 2.47.3