summaryrefslogtreecommitdiff
path: root/gsupplicant
diff options
context:
space:
mode:
authorJulien Massot <jmassot@aldebaran-robotics.com>2013-02-21 17:23:07 (GMT)
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-02-22 10:52:29 (GMT)
commit5230672c36edeb8ac49a365a10586fb1710071c4 (patch)
treefcc664734e797d4001583a2fbb68a4bf9836715e /gsupplicant
parent896120bead9a86ee1528cd6f1ff8949d183b9ed4 (diff)
downloadconnman-5230672c36edeb8ac49a365a10586fb1710071c4.zip
connman-5230672c36edeb8ac49a365a10586fb1710071c4.tar.gz
connman-5230672c36edeb8ac49a365a10586fb1710071c4.tar.bz2
gsupplicant: Set the scan callback in g_supplicant_interface_scan
The callback is required to properly handle scanning errors reported by wpa_supplicant through the scan_done signal. Steps to reproduce: 1. Set a country code to the WiFi card which have more frequencies allowed than the world roaming allow. 2. Connect to a WiFi network not available in the world roaming setup. 3. Stop connman. 4. Change the country code to 00, be sure the frequencies use in step 2. is no longer allowed. Take care of cfg80211 authorize frequencies when beacons are received, I prefer using mac80211_hwsim from here to avoid side effects about beacon reception. 5. Start connman again. Now ConnMan is stuck in scanning state as the scan_fast method of plugins/wifi.c is called with a forbidden frequency. wpa_supplicant returns an error received in "gsupplicant/supplicant.c: signal_scan_done", where the code enters 'if (success == FALSE)' but unfortunately scan_callback is NULL at this point as the scan_callback is normally set in interface_scan_result().
Diffstat (limited to 'gsupplicant')
-rw-r--r--gsupplicant/supplicant.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index f33c2df..be5e72b 100644
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -2886,6 +2886,9 @@ int g_supplicant_interface_scan(GSupplicantInterface *interface,
data->user_data = user_data;
data->scan_params = scan_data;
+ interface->scan_callback = callback;
+ interface->scan_data = user_data;
+
ret = supplicant_dbus_method_call(interface->path,
SUPPLICANT_INTERFACE ".Interface", "Scan",
interface_scan_params, interface_scan_result, data);