]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Do not use results from externally requested scan for network selection
authorJouni Malinen <j@w1.fi>
Thu, 26 Dec 2013 17:00:48 +0000 (19:00 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 26 Dec 2013 18:50:28 +0000 (20:50 +0200)
It may not always be desirable to trigger reassociation or network
change based on scan results from externally to wpa_supplicant trigger
scan operations. Skip network selection and roaming determination if the
received scan result is known to be triggered by something external to
wpa_supplicant. The control interface SCAN command can be used to
request wpa_supplicant to determine the best network.

Signed-hostap: Jouni Malinen <j@w1.fi>

wpa_supplicant/events.c

index 308e82e94a069957ca9edc775b563ae62f93c50c..062c696d05d2d88b0914447362fb3dd0d22b7302 100644 (file)
@@ -1279,6 +1279,12 @@ static int _wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
 
        wpas_notify_scan_done(wpa_s, 1);
 
+       if (!wpa_s->own_scan_running && wpa_s->external_scan_running) {
+               wpa_dbg(wpa_s, MSG_DEBUG, "Do not use results from externally requested scan operation for network selection");
+               wpa_scan_results_free(scan_res);
+               return 0;
+       }
+
        if (sme_proc_obss_scan(wpa_s) > 0) {
                wpa_scan_results_free(scan_res);
                return 0;