gsupplicant: Return zero for max scan SSID parameter
authorPatrik Flykt <patrik.flykt@linux.intel.com>
Thu, 14 Feb 2013 21:37:23 +0000 (23:37 +0200)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Mon, 18 Feb 2013 08:49:32 +0000 (10:49 +0200)
A driver can return a valid max scan SSID value of zero. Thus no fast
scans can be done, so the code falls back to a simple scan instead.

A value of zero is properly handled in plugins/wifi.c. An active scan
for a hidden SSID adds only the SSID parameter to the wpa_supplicant
D-Bus method call, which wpa_supplicant then handles properly.

Some drivers also report a max scan SSID value of one. In some of the
cases that value is bogus, the driver will not be able to do a fast
scan anyway. In addition, it is questionable why only one SSID can be
fast scanned as the feature would not differ much from an active scan
for a hidden network. Thus we set the limit to two, i.e. zero or one
is treated as zero, two or more is reported as is.

Thanks to Grant Erickson and Tomasz Bursztyka for finding and
pinpointing this issue.

Fixes BMC#25971

gsupplicant/supplicant.c

index e298bb5..f33c2df 100644 (file)
@@ -653,8 +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;
+               if (max_scan_ssid < 2)
+                       max_scan_ssid = 0;
                interface->max_scan_ssids = max_scan_ssid;
 
        } else