From 92db663514b36b4ff0609374fe658a6c25582555 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 11 Nov 2009 16:34:15 -0800 Subject: [PATCH] wifi: don't fail first scan after supplicant interface is ready If the supplicant interface became ready but the device was still UNAVAILABLE, requesting a scan before transitioning to DISCONNECTED would just fail because can_scan() returns FALSE when the device's state is not >= DISCONNECTED. Change device state first so that doesn't happen. --- src/nm-device-wifi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c index 90ff105441..6307ae6308 100644 --- a/src/nm-device-wifi.c +++ b/src/nm-device-wifi.c @@ -2245,10 +2245,6 @@ supplicant_iface_state_cb_handler (gpointer user_data) if (task->new_state == NM_SUPPLICANT_INTERFACE_STATE_READY) { priv->scan_interval = SCAN_INTERVAL_MIN; - /* Request a scan to get latest results */ - cancel_pending_scan (self); - request_wireless_scan (self); - /* If the interface can now be activated because the supplicant is now * available, transition to DISCONNECTED. */ @@ -2257,6 +2253,10 @@ supplicant_iface_state_cb_handler (gpointer user_data) nm_device_state_changed (NM_DEVICE (self), NM_DEVICE_STATE_DISCONNECTED, NM_DEVICE_STATE_REASON_SUPPLICANT_AVAILABLE); } + + /* Request a scan to get latest results */ + cancel_pending_scan (self); + request_wireless_scan (self); } else if (task->new_state == NM_SUPPLICANT_INTERFACE_STATE_DOWN) { cleanup_association_attempt (self, FALSE); supplicant_interface_release (self);