From 8a9ae52aea09fdb75a2d26942865d2667f7a8a3c Mon Sep 17 00:00:00 2001 From: kimocoder Date: Sun, 12 Jul 2020 01:11:40 +0000 Subject: [PATCH] Return zero length output to SIOCGIWESSID when not connected --- os_dep/linux/ioctl_linux.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/os_dep/linux/ioctl_linux.c b/os_dep/linux/ioctl_linux.c index b56b2dc..b5b9119 100644 --- a/os_dep/linux/ioctl_linux.c +++ b/os_dep/linux/ioctl_linux.c @@ -2459,25 +2459,19 @@ static int rtw_wx_get_essid(struct net_device *dev, struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); WLAN_BSSID_EX *pcur_bss = &pmlmepriv->cur_network.network; - - if ((check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) || (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == _TRUE)) { len = pcur_bss->Ssid.SsidLength; - - wrqu->essid.length = len; - - _rtw_memcpy(extra, pcur_bss->Ssid.Ssid, len); - - wrqu->essid.flags = 1; } else { - ret = -1; - goto exit; + len = 0; } + wrqu->essid.length = len; + + memcpy(extra, pcur_bss->Ssid.Ssid, len); + + wrqu->essid.flags = 1; exit: - - return ret; }