diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index ea1c60902..b0fb170af 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -2523,9 +2523,6 @@ static int _wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s, return 0; } - if (wnm_scan_process(wpa_s, false) > 0) - goto scan_work_done; - if (sme_proc_obss_scan(wpa_s) > 0) goto scan_work_done; @@ -2555,6 +2552,9 @@ static int _wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s, wpas_wps_update_ap_info(wpa_s, scan_res); + if (wnm_scan_process(wpa_s, false) > 0) + goto scan_work_done; + if (wpa_s->wpa_state >= WPA_AUTHENTICATING && wpa_s->wpa_state < WPA_COMPLETED) goto scan_work_done; diff --git a/wpa_supplicant/wnm_sta.c b/wpa_supplicant/wnm_sta.c index 7dc93ebff..a383ed803 100644 --- a/wpa_supplicant/wnm_sta.c +++ b/wpa_supplicant/wnm_sta.c @@ -1192,6 +1192,11 @@ int wnm_scan_process(struct wpa_supplicant *wpa_s, bool pre_scan_check) goto send_bss_resp_fail; } + if (!pre_scan_check && !wpa_s->wnm_transition_scan) + return 0; + + wpa_s->wnm_transition_scan = false; + /* Compare the Neighbor Report and scan results */ bss = compare_scan_neighbor_results(wpa_s, 0, &reason); @@ -1504,6 +1509,7 @@ static void ieee802_11_rx_bss_trans_mgmt_req(struct wpa_supplicant *wpa_s, if (wpa_s->wnm_dissoc_timer && !wpa_s->scanning && (!wpa_s->current_ssid || !wpa_s->current_ssid->bssid_set)) { wpa_printf(MSG_DEBUG, "Trying to find another BSS"); + wpa_s->wnm_transition_scan = true; wpa_supplicant_req_scan(wpa_s, 0, 0); } } @@ -1617,6 +1623,7 @@ static void ieee802_11_rx_bss_trans_mgmt_req(struct wpa_supplicant *wpa_s, "WNM: Scan only for a specific BSSID since there is only a single candidate " MACSTR, MAC2STR(wpa_s->next_scan_bssid)); } + wpa_s->wnm_transition_scan = true; wpa_supplicant_req_scan(wpa_s, 0, 0); } else if (reply) { enum bss_trans_mgmt_status_code status; diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h index 275bbf221..e001699ac 100644 --- a/wpa_supplicant/wpa_supplicant_i.h +++ b/wpa_supplicant/wpa_supplicant_i.h @@ -1302,6 +1302,7 @@ struct wpa_supplicant { u8 *mac_addr_pno; #ifdef CONFIG_WNM + bool wnm_transition_scan; u8 wnm_dialog_token; u8 wnm_reply; u8 wnm_num_neighbor_report;