]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Set NORMAL_SCAN_REQ on SELECT_NETWORK/ENABLE_NETWORK
authorJouni Malinen <j@w1.fi>
Sun, 16 Aug 2015 21:16:46 +0000 (00:16 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 16 Aug 2015 21:18:32 +0000 (00:18 +0300)
wpa_s->scan_req needs to be set in these cases to get correct scanning
behavior. This is mainly needed for starting of AP mode operation
immediately in ap_scan=2 case.

This fixes an issue that was found with mac80211_hwsim test cases in the
following sequence: dbus_autoscan dbus_ap_scan_2_ap_mode_scan

Signed-off-by: Jouni Malinen <j@w1.fi>
wpa_supplicant/wpa_supplicant.c

index 9a5d180beb3ff256c717800be94c9112d10de932..9951b0f4fc437876670d5bb221b1d748819898ed 100644 (file)
@@ -2581,8 +2581,10 @@ void wpa_supplicant_enable_network(struct wpa_supplicant *wpa_s,
                        wpa_supplicant_cancel_sched_scan(wpa_s);
                }
 
-               if (wpa_supplicant_fast_associate(wpa_s) != 1)
+               if (wpa_supplicant_fast_associate(wpa_s) != 1) {
+                       wpa_s->scan_req = NORMAL_SCAN_REQ;
                        wpa_supplicant_req_scan(wpa_s, 0, 0);
+               }
        }
 }
 
@@ -2710,8 +2712,10 @@ void wpa_supplicant_select_network(struct wpa_supplicant *wpa_s,
        wpa_s->reassociate = 1;
 
        if (wpa_s->connect_without_scan ||
-           wpa_supplicant_fast_associate(wpa_s) != 1)
+           wpa_supplicant_fast_associate(wpa_s) != 1) {
+               wpa_s->scan_req = NORMAL_SCAN_REQ;
                wpa_supplicant_req_scan(wpa_s, 0, disconnected ? 100000 : 0);
+       }
 
        if (ssid)
                wpas_notify_network_selected(wpa_s, ssid);