[broadcom]: respect the current network namespace when creating netdev (#3896)

https://github.com/Broadcom-Switch/OpenNSL/issues/26

Signed-off-by: Wataru Ishida <ishida@nel-america.com>
This commit is contained in:
Wataru Ishida 2019-12-23 10:27:22 -08:00 committed by lguohan
parent b6ad09aa35
commit ed2d5f8a32

View File

@ -6165,6 +6165,10 @@ bkn_init_ndev(u8 *mac, char *name)
strncpy(dev->name, name, IFNAMSIZ-1);
}
#ifdef CONFIG_NET_NS
dev_net_set(dev, current->nsproxy->net_ns);
#endif
/* Register the kernel Ethernet device */
if (register_netdev(dev)) {
DBG_WARN(("Error registering Ethernet device.\n"));