[PATCH] Dont exceed scan ssid max size advertised by driver

Undekari, Sunil Dutt usdutt at qti.qualcomm.com
Thu Jun 30 09:29:07 PDT 2016

I did discuss with Jouni earlier for a similar fix and his response was "Reserving an entry for WILDCARD_SSID_SCAN in this manner would be problematic since it would not allow even a single specific SSID to be scanned for with drivers that support only a single SSID per request.".
I agree with this and IMO , the number of hidden network ID's provided via the control interface should ensure to have a groom for this "wildcard" scan ssid entry ( the number should be one less than the max_size advertised by the driver).
This also asks for a new control interface command in wpa_supplicant to get the max_size supported by driver. 
I don't see any other option , if the hidden_ssids have to be provided through the control interface. 


-----Original Message-----
From: Hostap [mailto:hostap-bounces at lists.infradead.org] On Behalf Of Roshan Pius
Sent: Thursday, June 30, 2016 5:25 AM
To: hostap at lists.infradead.org
Cc: Roshan Pius <rpius at google.com>
Subject: [PATCH] Dont exceed scan ssid max size advertised by driver

Currently |wpa_set_scan_ssids| fully exhausts
|wpa_driver_scan_params.ssid| list when hidden network ID's
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 at google.com>
 wpa_supplicant/scan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c index 7a52826..8a29522 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -593,7 +593,7 @@ static void wpa_set_scan_ssids(struct wpa_supplicant *wpa_s,
 		if (j < params->num_ssids)
 			continue; /* already in the list */
-		if (params->num_ssids + 1 > max_ssids) {
+		if (params->num_ssids + 1 >= max_ssids) {
 				   "Over max scan SSIDs for manual request");

Hostap mailing list
Hostap at lists.infradead.org

More information about the Hostap mailing list