Skip to content

Commit

Permalink
[broadcom]: respect the current network namespace when creating netdev (
Browse files Browse the repository at this point in the history
sonic-net#3896)

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

Signed-off-by: Wataru Ishida <ishida@nel-america.com>
  • Loading branch information
ishidawataru authored and lguohan committed Dec 23, 2019
1 parent b6ad09a commit ed2d5f8
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down

0 comments on commit ed2d5f8

Please sign in to comment.