Update BSS entry on roaming only for actual BSS frequency change

Commit 117e812d06 ("Update BSS table entry if roaming event indicates
frequency change") added wpa_supplicant BSS table update based on the
latest driver scan results whenever processing an association event that
results in the current operating channel changing. While that is needed
to cover the case where an AP changes its own operating channel (and
that is noticed as a roam or new connection instead of a channel switch
event), this should not really be needed for cases where the
wpa_supplicant entry for the new BSS is already up to date.

Skip the full BSS table update on association event if the event is for
a roaming case to a different BSS and the BSS entry for the target is
already available and for the current operating channel. This avoids
undesired latency when processing the association event.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
This commit is contained in:
Jouni Malinen 2024-03-20 11:08:16 +02:00 committed by Jouni Malinen
parent 024d4bca13
commit 8d0bd7f9c8

View file

@ -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;