aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/scan.c
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2016-06-30 22:26:07 (GMT)
committerJouni Malinen <j@w1.fi>2016-07-03 16:13:42 (GMT)
commitef60f643ec50a3746b47aede5ae9f52410c7aa8e (patch)
tree3b2822b57da5359ca01533bf147b878084e1f483 /wpa_supplicant/scan.c
parent1c96988bc27a77143dd217c32d815f2e17c5af69 (diff)
downloadhostap-ef60f643ec50a3746b47aede5ae9f52410c7aa8e.zip
hostap-ef60f643ec50a3746b47aede5ae9f52410c7aa8e.tar.gz
hostap-ef60f643ec50a3746b47aede5ae9f52410c7aa8e.tar.bz2
Do not exceed scan ssid max size advertised by driver
Previously, wpa_set_scan_ssids() fully exhausted wpa_driver_scan_params.ssid list when hidden network IDs are provided via the control interface. This results in us exceeding the max size for the list advertised by the driver when we add the "wildcard" scan SSID entry. So, ensure that we leave space for one more scan SSID entry in the list when we exit out of wpa_set_scan_ssids(). Signed-off-by: Roshan Pius <rpius@google.com>
Diffstat (limited to 'wpa_supplicant/scan.c')
-rw-r--r--wpa_supplicant/scan.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
index 6ade9af..119da28 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -588,6 +588,12 @@ static void wpa_set_scan_ssids(struct wpa_supplicant *wpa_s,
unsigned int i;
struct wpa_ssid *ssid;
+ /*
+ * For devices with max_ssids greater than 1, leave the last slot empty
+ * for adding the wildcard scan entry.
+ */
+ max_ssids = max_ssids > 1 ? max_ssids - 1 : max_ssids;
+
for (i = 0; i < wpa_s->scan_id_count; i++) {
unsigned int j;