diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index f9ee7c0b6..c32610f9f 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -3622,12 +3622,21 @@ no_pfs: if (wpa_found || rsn_found) wpa_s->ap_ies_from_associnfo = 1; - if (wpa_s->assoc_freq && data->assoc_info.freq && - wpa_s->assoc_freq != data->assoc_info.freq) { - wpa_printf(MSG_DEBUG, "Operating frequency changed from " - "%u to %u MHz", - wpa_s->assoc_freq, data->assoc_info.freq); - wpa_supplicant_update_scan_results(wpa_s); + if (wpa_s->assoc_freq && data->assoc_info.freq) { + struct wpa_bss *bss; + unsigned int freq = 0; + + if (bssid_known) { + bss = wpa_bss_get_bssid_latest(wpa_s, bssid); + if (bss) + freq = bss->freq; + } + if (freq != data->assoc_info.freq) { + wpa_printf(MSG_DEBUG, + "Operating frequency changed from %u to %u MHz", + wpa_s->assoc_freq, data->assoc_info.freq); + wpa_supplicant_update_scan_results(wpa_s); + } } wpa_s->assoc_freq = data->assoc_info.freq;