netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Aloni <da-x@gmx.net>
To: Linux Net-Dev <netdev@oss.sgi.com>
Cc: "David S. Miller" <davem@redhat.com>, Mark Huth <mhuth@mvista.com>
Subject: [PATCH] network device renaming sysfs fix
Date: Fri, 15 Aug 2003 14:15:14 +0300	[thread overview]
Message-ID: <20030815111514.GA5228@callisto.yi.org> (raw)

(repost, now will hopefully reach the mailing list)

I believe this is a better approach for fixing the sysfs renaming
discrepancy. Later I'll also look into fixing the same issue 
with sysctl.

--- linux/net/core/dev.c	2003-08-15 12:47:50.000000000 +0300
+++ linux/net/core/dev.c	2003-08-15 12:47:59.000000000 +0300
@@ -2347,10 +2347,14 @@
 				return -EEXIST;
 			memcpy(dev->name, ifr->ifr_newname, IFNAMSIZ);
 			dev->name[IFNAMSIZ - 1] = 0;
-			strlcpy(dev->class_dev.class_id, dev->name, BUS_ID_SIZE);
+
+			err = class_device_rename(&dev->class_dev, dev->name);
+			if (err) 
+				printk(KERN_DEBUG "SIOCSIFNAME: error renaming class_device (%d)\n", err);
+
 			notifier_call_chain(&netdev_chain,
 					    NETDEV_CHANGENAME, dev);
-			return 0;
+			return err;
 
 		/*
 		 *	Unknown or private ioctl



-- 
Dan Aloni
da-x@gmx.net

             reply	other threads:[~2003-08-15 11:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-15 11:15 Dan Aloni [this message]
2003-08-15 16:37 ` [PATCH] network device renaming sysfs fix Stephen Hemminger
2003-08-15 16:50   ` Dan Aloni
2003-08-16 14:40   ` David S. Miller
2003-08-17  7:13     ` Dan Aloni
2003-08-15 18:09 ` Mark Huth
  -- strict thread matches above, loose matches on Subject: below --
2003-08-15 11:36 Hen, Shmulik
2003-08-15 11:45 ` Dan Aloni

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=20030815111514.GA5228@callisto.yi.org \
    --to=da-x@gmx.net \
    --cc=davem@redhat.com \
    --cc=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).