* Fix to have sysfs track rename of network devices
@ 2003-08-14 19:03 Mark Huth
2003-08-15 5:34 ` David S. Miller
0 siblings, 1 reply; 2+ messages in thread
From: Mark Huth @ 2003-08-14 19:03 UTC (permalink / raw)
To: netdev
[-- Attachment #1.1: Type: text/plain, Size: 274 bytes --]
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
[-- Attachment #1.2: Type: text/html, Size: 608 bytes --]
[-- Attachment #2: 2.6.0-test3-fixifrename.patch --]
[-- Type: application/octet-stream, Size: 670 bytes --]
diff -uNr linux-2.6.0-test3/net/core/dev.c linux-2.6.0-test3-fixifrename/net/core/dev.c
--- linux-2.6.0-test3/net/core/dev.c 2003-08-08 21:36:50.000000000 -0700
+++ linux-2.6.0-test3-fixifrename/net/core/dev.c 2003-08-13 16:11:03.000000000 -0700
@@ -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;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-08-15 5:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-14 19:03 Fix to have sysfs track rename of network devices Mark Huth
2003-08-15 5:34 ` David S. Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).