1
0
mirror of https://github.com/aircrack-ng/rtl8812au.git synced 2024-11-22 21:34:37 +00:00

Return zero length output to SIOCGIWESSID when not connected

This commit is contained in:
kimocoder 2020-07-12 01:11:40 +00:00
parent c2668290e3
commit 8a9ae52aea

View File

@ -2459,25 +2459,19 @@ static int rtw_wx_get_essid(struct net_device *dev,
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
WLAN_BSSID_EX *pcur_bss = &pmlmepriv->cur_network.network; WLAN_BSSID_EX *pcur_bss = &pmlmepriv->cur_network.network;
if ((check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) || if ((check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) ||
(check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == _TRUE)) { (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == _TRUE)) {
len = pcur_bss->Ssid.SsidLength; len = pcur_bss->Ssid.SsidLength;
wrqu->essid.length = len;
_rtw_memcpy(extra, pcur_bss->Ssid.Ssid, len);
wrqu->essid.flags = 1;
} else { } else {
ret = -1; len = 0;
goto exit;
} }
wrqu->essid.length = len;
memcpy(extra, pcur_bss->Ssid.Ssid, len);
wrqu->essid.flags = 1;
exit: exit:
return ret; return ret;
} }