[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8729016553E3654398EA69218DA29EEF0E42F7ED@cnshjmbx02>
Date: Wed, 16 Nov 2016 03:57:08 +0000
From: YUAN Linyu <Linyu.Yuan@...atel-sbell.com.cn>
To: David Miller <davem@...emloft.net>
CC: "cugyly@....com" <cugyly@....com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: RE: [PATCH] net: ioctl SIOCSIFADDR minor cleanup
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:davem@...emloft.net]
> Sent: Wednesday, November 16, 2016 11:31 AM
> To: YUAN Linyu
> Cc: cugyly@....com; netdev@...r.kernel.org
> Subject: Re: [PATCH] net: ioctl SIOCSIFADDR minor cleanup
>
> From: YUAN Linyu <Linyu.Yuan@...atel-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.
Powered by blists - more mailing lists