From 6af0579c434058536fb40480f40f5e9895cfe863 Mon Sep 17 00:00:00 2001 From: Patrik Flykt Date: Thu, 14 Feb 2013 23:37:23 +0200 Subject: [PATCH] gsupplicant: Return zero for max scan SSID parameter 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c index e298bb5..f33c2df 100644 --- a/gsupplicant/supplicant.c +++ b/gsupplicant/supplicant.c @@ -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 -- 2.7.4