]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wpa_supplicant: Do not allow fast associate before scanning 6 GHz
authorIlan Peer <ilan.peer@intel.com>
Mon, 8 Apr 2024 13:07:01 +0000 (16:07 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 21 Apr 2024 08:55:53 +0000 (11:55 +0300)
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>
wpa_supplicant/events.c
wpa_supplicant/scan.c

index 823556e3a4e0a440e60f12ba97a1410e51f8ea2f..8dc618e5c05dfbc6e23048b75513a29565811d73 100644 (file)
@@ -2843,6 +2843,9 @@ int wpa_supplicant_fast_associate(struct wpa_supplicant *wpa_s)
                               wpa_s->conf->scan_res_valid_for_connect)) {
                wpa_printf(MSG_DEBUG, "Fast associate: Old scan results");
                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);
@@ -5219,11 +5222,10 @@ void wpa_supplicant_update_channel_list(struct wpa_supplicant *wpa_s,
                        wpa_dbg(ifs, MSG_DEBUG,
                                "Channel list changed - restart sched_scan");
                        wpas_scan_restart_sched_scan(ifs);
-               } else if (ifs->scanning && !was_6ghz_enabled &&
-                          ifs->is_6ghz_enabled) {
-                       /* Look for APs in the 6 GHz band */
+               } else if (!was_6ghz_enabled && ifs->is_6ghz_enabled) {
                        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;
                }
        }
index ccd694bd0eaa61dbf05881a5642450a809e5cc6f..8b59e409b81dc29bf9293fa5f24ef22f0abace99 100644 (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_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 ||
            radio_add_work(wpa_s, 0, "scan", next, wpas_trigger_scan_cb,
                           ctx) < 0) {