From a5043d715b61d103eae860f0ecafa741a3a585f6 Mon Sep 17 00:00:00 2001 From: kimocoder Date: Thu, 19 Sep 2019 13:24:09 +0000 Subject: [PATCH] Add support for network namespaces --- Makefile | 1 + dkms.conf | 2 +- os_dep/linux/ioctl_cfg80211.c | 3 +++ os_dep/linux/os_intfs.c | 3 +++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ff96e2b..be54cef 100755 --- a/Makefile +++ b/Makefile @@ -56,6 +56,7 @@ CONFIG_BR_EXT = y CONFIG_TDLS = n CONFIG_AP_MODE = n CONFIG_WIFI_MONITOR = y +CONFIG_NET_NS = y # If you are setting up AP (e.g. by hostapd) in 802.11ac mode, you may have to choose 'y' below. # Otherwise some channels may be flagged 'NO-IR' (i.e. Passive scanning) by the driver. CONFIG_DISABLE_REGD_C=y diff --git a/dkms.conf b/dkms.conf index 03b3b1f..c62a506 100644 --- a/dkms.conf +++ b/dkms.conf @@ -1,5 +1,5 @@ PACKAGE_NAME="realtek-rtl88xxau" -PACKAGE_VERSION="5.6.4.1~20190908" +PACKAGE_VERSION="5.6.4.1~20190919" CLEAN="'make' clean" BUILT_MODULE_NAME[0]=88XXau PROCS_NUM=`nproc` diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index d0aea67..24cd0f9 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -9759,6 +9759,9 @@ struct ieee80211_supported_band *band; #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 diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c index 95daf6d..34cf8b8 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -1708,6 +1708,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 */