netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Huth <mhuth@mvista.com>
To: netdev@oss.sgi.com
Subject: Fix to have sysfs track rename of network devices
Date: Thu, 14 Aug 2003 12:03:15 -0700	[thread overview]
Message-ID: <3F3BDCF3.5050708@mvista.com> (raw)


[-- 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;

             reply	other threads:[~2003-08-14 19:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-14 19:03 Mark Huth [this message]
2003-08-15  5:34 ` Fix to have sysfs track rename of network devices David S. Miller

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=3F3BDCF3.5050708@mvista.com \
    --to=mhuth@mvista.com \
    --cc=netdev@oss.sgi.com \
    /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).