summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJo-Philipp Wich2019-10-16 14:40:41 +0000
committerJo-Philipp Wich2019-10-16 14:41:55 +0000
commit07315b6fdb2566a8626d8a1e4de76eb30456fe17 (patch)
tree0bbaf5066675df86ed8d9842f6c07ce9120339a1
parent3ac846e7dc915969fba316d3070d327a94aefbbe (diff)
downloadiwinfo-07315b6fdb2566a8626d8a1e4de76eb30456fe17.tar.gz
nl80211: handle hidden SSIDs in wpa_supplicant scan results
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r--iwinfo_nl80211.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/iwinfo_nl80211.c b/iwinfo_nl80211.c
index c7b0222..4b6ef91 100644
--- a/iwinfo_nl80211.c
+++ b/iwinfo_nl80211.c
@@ -2560,7 +2560,7 @@ static int nl80211_get_scanlist_wpactl(const char *ifname, char *buf, int *len)
flags = strtok(NULL, "\t");
ssid = strtok(NULL, "\n");
- if (!bssid || !freq || !signal || !flags || !ssid)
+ if (!bssid || !freq || !signal || !flags)
continue;
/* BSSID */
@@ -2572,7 +2572,10 @@ static int nl80211_get_scanlist_wpactl(const char *ifname, char *buf, int *len)
e->mac[5] = strtol(&bssid[15], NULL, 16);
/* SSID */
- wpasupp_ssid_decode(ssid, e->ssid, sizeof(e->ssid));
+ if (ssid)
+ wpasupp_ssid_decode(ssid, e->ssid, sizeof(e->ssid));
+ else
+ e->ssid[0] = 0;
/* Mode */
if (strstr(flags, "[MESH]"))