No, this patch will not change dev->name,
It's care about ifa->ifa_label.
> -                     if (colon)
> -                             memcpy(ifa->ifa_label, ifr.ifr_name, IFNAMSIZ);
> -                     else
> -                             memcpy(ifa->ifa_label, dev->name, IFNAMSIZ);
When ifr.ifr_name have no colon, dev->name must equal to ifr.ifr_name.
So we change to 
> -                     else
> -                             memcpy(ifa->ifa_label, ifr.ifr_name, IFNAMSIZ);
Then if and else do same thing. Just one line is enough,
memcpy(ifa->ifa_label, ifr.ifr_name, IFNAMSIZ);

> -----Original Message-----
> From: David Miller [mailto:da...@davemloft.net]
> Sent: Wednesday, November 16, 2016 11:31 AM
> To: YUAN Linyu
> Cc: cug...@163.com; netdev@vger.kernel.org
> Subject: Re: [PATCH] net: ioctl SIOCSIFADDR minor cleanup
> 
> From: YUAN Linyu <linyu.y...@alcatel-sbell.com.cn>
> Date: Wed, 16 Nov 2016 03:13:31 +0000
> 
> > So assign label to request name will do same thing as original code.
> 
> Nope.  dev->name does not have the colon, it was trimmed from the
> string for the device lookup.  So the found device's dev->name does
> not have the colon character, even if it was in ifr.ifr_name
> 
> This was my entire point.
> 
> You are changing the behvaior of the code in an invalid way.

Reply via email to