chiark / gitweb /
export INTERFACE_OLD if we renamed a netif
[elogind.git] / udev_device.c
index 14c8d39..84d0ab2 100644 (file)
@@ -149,6 +149,9 @@ int udev_device_event(struct udev_rules *rules, struct udevice *udev)
                                goto exit;
                        info("renamed netif to '%s'", udev->name);
 
+                       /* export old name */
+                       setenv("INTERFACE_OLD", udev->dev->kernel_name, 1);
+
                        /* now fake the devpath, because the kernel name changed silently */
                        pos = strrchr(udev->dev->devpath, '/');
                        if (pos != NULL) {