aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2016-09-09 18:29:52 +0530
committerqcabuildsw <qcabuildsw@localhost>2016-10-26 23:11:23 -0700
commit9370edb9995ddb403e6856919050435e9d99520a (patch)
treed7f12c1a4ddd61422e8c76c4d023d47eaa7cb8b6
parent2886779ab50ec275b1386cb00a356df678bd5c0e (diff)
downloadandroid_external_wpa_supplicant_8-9370edb9995ddb403e6856919050435e9d99520a.tar.gz
android_external_wpa_supplicant_8-9370edb9995ddb403e6856919050435e9d99520a.tar.bz2
android_external_wpa_supplicant_8-9370edb9995ddb403e6856919050435e9d99520a.zip
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> Git-commit: ef60f643ec50a3746b47aede5ae9f52410c7aa8e Git-repo: git://w1.fi/srv/git/hostap.git CRs-fixed: 1065138 Change-Id: Ibdf6c9e64cd706283ff59d7b472e3ac596272e69
-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 09c7bd89..4b450d7b 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -616,6 +616,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;