gsupplicant: Return max SSIDs to scan given by wpa_supplicant
authorPatrik Flykt <patrik.flykt@linux.intel.com>
Tue, 8 Jan 2013 09:32:51 +0000 (11:32 +0200)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Fri, 11 Jan 2013 13:34:04 +0000 (15:34 +0200)
Although it seems wpa_supplicant can handle 4 SSIDs in version 0.7.x
and 16 starting with 0.8.x, in practise this does not work. Return the
value reported without relying on wpa_supplicant internals to handle
the situation. In order for hidden scans to work properly, the minimum
value needs to be 1.

gsupplicant/gsupplicant.h
gsupplicant/supplicant.c

index 790cfed..1b1fce2 100644 (file)
@@ -138,15 +138,6 @@ struct _GSupplicantSSID {
 
 typedef struct _GSupplicantSSID GSupplicantSSID;
 
-/*
- * Max number of SSIDs that can be scanned.
- * In wpa_s 0.7x the limit is 4.
- * In wps_s 0.8 or later it is 16.
- * The value is only used if wpa_supplicant does not return any max limit
- * for number of scannable SSIDs.
- */
-#define WPAS_MAX_SCAN_SSIDS 4
-
 struct scan_ssid {
        unsigned char ssid[32];
        uint8_t ssid_len;
index d9dfdbb..e298bb5 100644 (file)
@@ -653,6 +653,8 @@ static void interface_capability(const char *key, DBusMessageIter *iter,
                dbus_int32_t max_scan_ssid;
 
                dbus_message_iter_get_basic(iter, &max_scan_ssid);
+               if (max_scan_ssid < 1)
+                       max_scan_ssid = 1;
                interface->max_scan_ssids = max_scan_ssid;
 
        } else
@@ -764,9 +766,6 @@ unsigned int g_supplicant_interface_get_max_scan_ssids(
        if (interface == NULL)
                return 0;
 
-       if (interface->max_scan_ssids == 0)
-               return WPAS_MAX_SCAN_SSIDS;
-
        return interface->max_scan_ssids;
 }