From 2c782c73b70434ce5e880c1745a906074e539a55 Mon Sep 17 00:00:00 2001 From: kimocoder Date: Fri, 29 Mar 2019 00:31:26 +0100 Subject: [PATCH] do not remove device if it is not of type monitor --- Makefile | 2 +- os_dep/linux/ioctl_cfg80211.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 519dfd6..d45bdb4 100755 --- a/Makefile +++ b/Makefile @@ -105,7 +105,7 @@ CONFIG_PLATFORM_ARM_RPI = n CONFIG_PLATFORM_ARM64_RPI = n CONFIG_PLATFORM_ANDROID_X86 = n CONFIG_PLATFORM_ANDROID_INTEL_X86 = n -CONFIG_PLATFORM_ARM_NETHUNTER = y +CONFIG_PLATFORM_ARM_NETHUNTER = n CONFIG_PLATFORM_JB_X86 = n CONFIG_PLATFORM_ARM_S3C2K4 = n CONFIG_PLATFORM_ARM_PXA2XX = n diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index 4a060e7..d919255 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -4347,7 +4347,11 @@ static int cfg80211_rtw_del_virtual_intf(struct wiphy *wiphy, pwdev_priv = adapter_wdev_data(adapter); if (ndev == pwdev_priv->pmon_ndev) { - unregister_netdevice(ndev); + /* unregister only monitor device + * because only monitor can be added + */ + if(wdev->iftype == NL80211_IFTYPE_MONITOR) + unregister_netdevice(ndev); pwdev_priv->pmon_ndev = NULL; pwdev_priv->ifname_mon[0] = '\0'; RTW_INFO(FUNC_NDEV_FMT" remove monitor ndev\n", FUNC_NDEV_ARG(ndev));