From: Yu Watanabe Date: Wed, 5 Mar 2025 23:19:45 +0000 (+0900) Subject: udev-event: set INTERFACE/INTERFACE_OLD property on rename only when the device is... X-Git-Tag: v258-rc1~1101^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4352457a9697da0466c03915aa10bc64ee4a328b;p=thirdparty%2Fsystemd.git 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. --- 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);