Thread (6 messages) 6 messages, 5 authors, 2007-10-29

Re: [bug, 2.6.24-rc1] sysfs: duplicate filename 'eth0' can not be created

From: David Miller <davem@davemloft.net>
Date: 2007-10-29 22:36:48
Also in: lkml
Subsystem: networking [general], the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

From: Ingo Molnar <redacted>
Date: Mon, 29 Oct 2007 22:17:46 +0100
hm, this seems to have popped up in the last few days, never had it 
before:

  sysfs: duplicate filename 'eth0' can not be created
  WARNING: at fs/sysfs/dir.c:424 sysfs_add_one()
I checked in a change from Stephen Hemminger last week which
should keep this case from emitting warning messages.

commit c8d90dca3211966ba5189e0f3d4bccd558d9ae08
Author: Stephen Hemminger [off-list ref]
Date:   Fri Oct 26 03:53:42 2007 -0700

    [NET] dev_change_name: ignore changes to same name
    
    Prevent error/backtrace from dev_rename() when changing
    name of network device to the same name. This is a common
    situation with udev and other scripts that bind addr to device.
    
    Signed-off-by: Stephen Hemminger [off-list ref]
    Signed-off-by: David S. Miller [off-list ref]
diff --git a/net/core/dev.c b/net/core/dev.c
index f1647d7..ddfef3b 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -883,6 +883,9 @@ int dev_change_name(struct net_device *dev, char *newname)
 	if (!dev_valid_name(newname))
 		return -EINVAL;
 
+	if (strncmp(newname, dev->name, IFNAMSIZ) == 0)
+		return 0;
+
 	memcpy(oldname, dev->name, IFNAMSIZ);
 
 	if (strchr(newname, '%')) {
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help