Skip to content

Commit

Permalink
Add support for network namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
kimocoder committed Feb 14, 2019
1 parent a6a2911 commit cb3d262
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Expand Up @@ -54,6 +54,7 @@ CONFIG_PCI_HCI = n
CONFIG_SDIO_HCI = n
CONFIG_GSPI_HCI = n
########################## Features ###########################
CONFIG_NET_NS = n
CONFIG_MP_INCLUDED = y
CONFIG_POWER_SAVING = n
CONFIG_USB_AUTOSUSPEND = n
Expand Down
3 changes: 3 additions & 0 deletions os_dep/linux/ioctl_cfg80211.c
Expand Up @@ -9058,6 +9058,9 @@ static void rtw_cfg80211_preinit_wiphy(_adapter *adapter, struct wiphy *wiphy)
#endif

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38) && LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0))
#if defined(CONFIG_NET_NS)
wiphy->flags |= WIPHY_FLAG_NETNS_OK;
#endif //CONFIG_NET_NS
wiphy->flags |= WIPHY_FLAG_SUPPORTS_SEPARATE_DEFAULT_KEYS;
#endif

Expand Down
3 changes: 3 additions & 0 deletions os_dep/linux/os_intfs.c
Expand Up @@ -1626,6 +1626,9 @@ int rtw_os_ndev_register(_adapter *adapter, const char *name)
rtw_init_netdev_name(ndev, name);

_rtw_memcpy(ndev->dev_addr, adapter_mac_addr(adapter), ETH_ALEN);
#if defined(CONFIG_NET_NS)
dev_net_set(ndev, wiphy_net(adapter_to_wiphy(adapter)));
#endif //defined(CONFIG_NET_NS)

/* Tell the network stack we exist */

Expand Down

0 comments on commit cb3d262

Please sign in to comment.