netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dev_change_name: ignore changes to same name
@ 2007-10-24 13:44 Stephen Hemminger
  2007-10-26 10:53 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2007-10-24 13:44 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev

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 <shemminger@linux-foundation.org>

--- a/net/core/dev.c	2007-10-24 06:01:31.000000000 -0700
+++ b/net/core/dev.c	2007-10-24 06:41:18.000000000 -0700
@@ -885,6 +885,9 @@ int dev_change_name(struct net_device *d
 	if (!dev_valid_name(newname))
 		return -EINVAL;
 
+	if (strncmp(newname, dev->name, IFNAMSIZ) == 0)
+		return 0;
+
 	memcpy(oldname, dev->name, IFNAMSIZ);
 
 	if (strchr(newname, '%')) {

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

end of thread, other threads:[~2007-10-26 17:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-24 13:44 [PATCH] dev_change_name: ignore changes to same name Stephen Hemminger
2007-10-26 10:53 ` David Miller
2007-10-26 17:51   ` Rick Jones

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