From: Stephen Hemminger Date: Fri, 26 Oct 2007 10:53:42 +0000 (-0700) Subject: [NET] dev_change_name: ignore changes to same name X-Git-Tag: v2.6.24-rc2~132^2~11 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=c8d90dca3211966ba5189e0f3d4bccd558d9ae08;p=linux-2.6-omap-h63xx.git [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 Signed-off-by: David S. Miller --- diff --git a/net/core/dev.c b/net/core/dev.c index f1647d7dd14..ddfef3b45ba 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, '%')) {