wpa_supplicant: Do not allow fast associate before scanning 6 GHz

In case the channel map was updated to include the 6 GHz but these channels
were not scanned yet, do not allow fast associate.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
This commit is contained in:
Ilan Peer 2024-04-08 16:07:01 +03:00 committed by Jouni Malinen
parent ff798fbb83
commit cf36ffd43c
2 changed files with 12 additions and 4 deletions

View file

@ -2843,6 +2843,9 @@ int wpa_supplicant_fast_associate(struct wpa_supplicant *wpa_s)
wpa_s->conf->scan_res_valid_for_connect)) { wpa_s->conf->scan_res_valid_for_connect)) {
wpa_printf(MSG_DEBUG, "Fast associate: Old scan results"); wpa_printf(MSG_DEBUG, "Fast associate: Old scan results");
return -1; return -1;
} else if (wpa_s->crossed_6ghz_dom) {
wpa_printf(MSG_DEBUG, "Fast associate: Crossed 6 GHz domain");
return -1;
} }
return wpas_select_network_from_last_scan(wpa_s, 0, 1, false, NULL); return wpas_select_network_from_last_scan(wpa_s, 0, 1, false, NULL);
@ -5219,11 +5222,10 @@ void wpa_supplicant_update_channel_list(struct wpa_supplicant *wpa_s,
wpa_dbg(ifs, MSG_DEBUG, wpa_dbg(ifs, MSG_DEBUG,
"Channel list changed - restart sched_scan"); "Channel list changed - restart sched_scan");
wpas_scan_restart_sched_scan(ifs); wpas_scan_restart_sched_scan(ifs);
} else if (ifs->scanning && !was_6ghz_enabled && } else if (!was_6ghz_enabled && ifs->is_6ghz_enabled) {
ifs->is_6ghz_enabled) {
/* Look for APs in the 6 GHz band */
wpa_dbg(ifs, MSG_INFO, wpa_dbg(ifs, MSG_INFO,
"Channel list changed - trigger 6 GHz-only scan"); "Channel list changed: 6 GHz was enabled");
ifs->crossed_6ghz_dom = true; ifs->crossed_6ghz_dom = true;
} }
} }

View file

@ -322,6 +322,12 @@ int wpa_supplicant_trigger_scan(struct wpa_supplicant *wpa_s,
} }
wpa_s->last_scan_all_chan = !params->freqs; wpa_s->last_scan_all_chan = !params->freqs;
wpa_s->last_scan_non_coloc_6ghz = params->non_coloc_6ghz; wpa_s->last_scan_non_coloc_6ghz = params->non_coloc_6ghz;
if (wpa_s->crossed_6ghz_dom) {
wpa_printf(MSG_DEBUG, "First scan after crossing 6 GHz domain");
wpa_s->crossed_6ghz_dom = false;
}
if (!ctx || if (!ctx ||
radio_add_work(wpa_s, 0, "scan", next, wpas_trigger_scan_cb, radio_add_work(wpa_s, 0, "scan", next, wpas_trigger_scan_cb,
ctx) < 0) { ctx) < 0) {