netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Olaf Hering <olaf@aepfle.de>
To: netdev@vger.kernel.org
Subject: [PATCH] keep track of network interface renaming
Date: Tue, 15 Aug 2006 18:56:35 +0200	[thread overview]
Message-ID: <20060815165635.GA31291@aepfle.de> (raw)


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

             reply	other threads:[~2006-08-15 16:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-15 16:56 Olaf Hering [this message]
2006-08-16  2:35 ` [PATCH] keep track of network interface renaming Patrick McHardy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060815165635.GA31291@aepfle.de \
    --to=olaf@aepfle.de \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).