netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] network device renaming sysfs fix
@ 2003-08-15 11:15 Dan Aloni
  2003-08-15 16:37 ` Stephen Hemminger
  2003-08-15 18:09 ` Mark Huth
  0 siblings, 2 replies; 8+ messages in thread
From: Dan Aloni @ 2003-08-15 11:15 UTC (permalink / raw)
  To: Linux Net-Dev; +Cc: David S. Miller, Mark Huth

(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

^ permalink raw reply	[flat|nested] 8+ messages in thread
* RE: [PATCH] network device renaming sysfs fix
@ 2003-08-15 11:36 Hen, Shmulik
  2003-08-15 11:45 ` Dan Aloni
  0 siblings, 1 reply; 8+ messages in thread
From: Hen, Shmulik @ 2003-08-15 11:36 UTC (permalink / raw)
  To: Dan Aloni, Linux Net-Dev; +Cc: David S. Miller, Mark Huth

> -----Original Message-----
> From: Dan Aloni [mailto:da-x@gmx.net]
> Sent: Friday, August 15, 2003 2:15 PM
> To: Linux Net-Dev
> Cc: David S. Miller; Mark Huth
> Subject: [PATCH] network device renaming sysfs fix
> 
> 
> (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.
> 
> 
> -- 
> Dan Aloni
> da-x@gmx.net
> 
> 

In general, it a similar thing applicable for proc fs too ?
We just had to fix something like that in bonding, and
it sounds odd each driver should handle this on it's own.

-- 
| Shmulik Hen   Advanced Network Services  |
| Israel Design Center, Jerusalem          |
| LAN Access Division, Platform Networking |
| Intel Communications Group, Intel corp.  |

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

end of thread, other threads:[~2003-08-17  7:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-15 11:15 [PATCH] network device renaming sysfs fix Dan Aloni
2003-08-15 16:37 ` 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

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