Skip to contentSkip to conversation

dev_change_name: ignore changes to same name

PATCH In review Stephen Hemminger 3 participants 3 messages Oct 24, 2007 – Oct 26, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

net/core/dev.c +3 -0
@@ -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, '%')) {
maintainer
#1 lore raw

From: Stephen Hemminger <[email protected]>
Date: Wed, 24 Oct 2007 06:44:45 -0700

Quoted 5 lines

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.

Fair enough, applied.

#2 lore raw
Quoted 4 lines · David Miller

From: Stephen Hemminger <[email protected]>
Date: Wed, 24 Oct 2007 06:44:45 -0700

Quoted 8 lines
Quoted 5 lines

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.

Fair enough, applied.

Very timely! I'd just built/booted a 2.6.24-rc1 kernel yesterday and it spent quite a long time with stack traces (I have 16 interfaces on the system and a 9600 baud console...I can only imagine what it would have been like on a big system...). With the patch applied to that tree, it is now down to only three or so stack traces related to renames that were not there on 2.6.23.mumble. Not sure if that warrants an acked-by but feel free if it makes sense. (I'm still really fuzzy on those, even after reading SubmittingPatches)

rick jones