Message ID | 1495013006-3011-1-git-send-email-zhangshengju@cmss.chinamobile.com |
---|---|
State | Rejected, archived |
Delegated to: | David Miller |
Headers | show |
From: Zhang Shengju <zhangshengju@cmss.chinamobile.com> Date: Wed, 17 May 2017 17:23:26 +0800 > Since register_netdevice() already call add_device_randomness() and > dev_set_mac_address() will call it after mac address change. > It's not necessary to call at device UP. > > Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com> __dev_open() can (at least theroretically) do things which adjust the MAC address, and therefore the add_device_randomness() call is appropriate. And even if ->ndo_open() implementations do not do so currently, I do not want to prevent it from doing so. I am not applying this patch, sorry.
diff --git a/net/core/dev.c b/net/core/dev.c index 35a06ce..cb48e40 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -1347,7 +1347,6 @@ static int __dev_open(struct net_device *dev) dev->flags |= IFF_UP; dev_set_rx_mode(dev); dev_activate(dev); - add_device_randomness(dev->dev_addr, dev->addr_len); } return ret;
Since register_netdevice() already call add_device_randomness() and dev_set_mac_address() will call it after mac address change. It's not necessary to call at device UP. Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com> --- net/core/dev.c | 1 - 1 file changed, 1 deletion(-)