netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] keep track of network interface renaming
@ 2006-08-15 16:56 Olaf Hering
  2006-08-16  2:35 ` Patrick McHardy
  0 siblings, 1 reply; 2+ messages in thread
From: Olaf Hering @ 2006-08-15 16:56 UTC (permalink / raw)
  To: netdev


Keep track about which network interface names were renamed after the
network device driver printed its banner. Previous kernel names will
be reused when new interfaces get registerd.
Recent udev scripts implement a stable kernel device name for network
interfaces.
This printk avoids confusion about what network hardware maps to what
kernel interface in later driver or network stack messages.

Signed-off-by: Olaf Hering <olaf@aepfle.de>

---
 net/core/dev.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Index: linux-2.6.18-rc4/net/core/dev.c
===================================================================
--- linux-2.6.18-rc4.orig/net/core/dev.c
+++ linux-2.6.18-rc4/net/core/dev.c
@@ -738,8 +738,11 @@ int dev_change_name(struct net_device *d
 	}
 	else if (__dev_get_by_name(newname))
 		return -EEXIST;
-	else
+	else {
+		if (strcmp(newname, dev->name))
+			printk(KERN_INFO "%s renamed to %s\n", dev->name, newname);
 		strlcpy(dev->name, newname, IFNAMSIZ);
+	}
 
 	err = class_device_rename(&dev->class_dev, dev->name);
 	if (!err) {

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-08-16  2:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-15 16:56 [PATCH] keep track of network interface renaming Olaf Hering
2006-08-16  2:35 ` Patrick McHardy

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).