Fix to have sysfs track rename of network devices
Subsystems (2)
Description:
When an Ethernet interface is renamed in the kernel via the ioctl SIOCSIFNAME, the sysfs directories /sys/class/net/ethX are not changed to the new name. This patch ensures sysfs is updated to the new name specified by the rename ioctl.
Thanks,
Mark Huth
net/core/dev.c +2 -0
@@ -2345,9 +2345,11 @@return -EBUSY ;if (__dev_get_by_name (ifr->ifr_newname))return -EEXIST ; +netdev_unregister_sysfs (dev);memcpy (dev->name, ifr->ifr_newname,IFNAMSIZ ); dev->name[IFNAMSIZ -1 ] =0 ;strlcpy (dev->class_dev.class_id, dev->name,BUS_ID_SIZE ); +netdev_register_sysfs (dev);notifier_call_chain (&netdev_chain,NETDEV_CHANGENAME , dev);return 0 ;
Please don't use HTML encoded emails on this list. It makes you look like a bozo. :-)