OWE: Optimize transition mode scan to use known channels

If the currently available scan results include OWE transition mode BSS
with an unknown SSID, optimize the following scan for OWE to use only
the channels on which a known transition mode BSS has been seen.

This is needed to be able to remove the design that updates BSS entries
with the learned OWE SSID in manner that does not result in regression
to scanning latencies.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
This commit is contained in:
Jouni Malinen 2023-11-08 14:19:03 +02:00 committed by Jouni Malinen
parent 5b12a05590
commit 9c97126576
3 changed files with 38 additions and 0 deletions

View file

@ -1600,6 +1600,22 @@ skip_assoc_disallow:
#endif /* CONFIG_SAE_PK */
if (bss->ssid_len == 0) {
#ifdef CONFIG_OWE
const u8 *owe_ssid = NULL;
size_t owe_ssid_len = 0;
owe_trans_ssid(wpa_s, bss, &owe_ssid, &owe_ssid_len);
if (owe_ssid && owe_ssid_len &&
owe_ssid_len == ssid->ssid_len &&
os_memcmp(owe_ssid, ssid->ssid, owe_ssid_len) == 0) {
if (debug_print)
wpa_dbg(wpa_s, MSG_DEBUG,
" skip - no SSID in BSS entry for a possible OWE transition mode BSS");
int_array_add_unique(&wpa_s->owe_trans_scan_freq,
bss->freq);
return false;
}
#endif /* CONFIG_OWE */
if (debug_print)
wpa_dbg(wpa_s, MSG_DEBUG,
" skip - no SSID known for the BSS");
@ -2556,6 +2572,10 @@ static int wpas_select_network_from_last_scan(struct wpa_supplicant *wpa_s,
return 0; /* no normal connection on p2p_mgmt interface */
wpa_s->owe_transition_search = 0;
#ifdef CONFIG_OWE
os_free(wpa_s->owe_trans_scan_freq);
wpa_s->owe_trans_scan_freq = NULL;
#endif /* CONFIG_OWE */
selected = wpa_supplicant_pick_network(wpa_s, &ssid);
#ifdef CONFIG_MESH
@ -2675,6 +2695,13 @@ static int wpas_select_network_from_last_scan(struct wpa_supplicant *wpa_s,
"OWE: Use shorter wait during transition mode search");
timeout_sec = 0;
timeout_usec = 500000;
if (wpa_s->owe_trans_scan_freq) {
os_free(wpa_s->next_scan_freqs);
wpa_s->next_scan_freqs =
wpa_s->owe_trans_scan_freq;
wpa_s->owe_trans_scan_freq = NULL;
timeout_usec = 100000;
}
wpa_supplicant_req_new_scan(wpa_s, timeout_sec,
timeout_usec);
return 0;

View file

@ -749,6 +749,11 @@ static void wpa_supplicant_cleanup(struct wpa_supplicant *wpa_s)
#endif /* CONFIG_PASN */
wpas_scs_deinit(wpa_s);
wpas_dscp_deinit(wpa_s);
#ifdef CONFIG_OWE
os_free(wpa_s->owe_trans_scan_freq);
wpa_s->owe_trans_scan_freq = NULL;
#endif /* CONFIG_OWE */
}

View file

@ -1576,6 +1576,12 @@ struct wpa_supplicant {
struct wpa_ssid *ml_connect_probe_ssid;
struct wpa_bss *ml_connect_probe_bss;
#ifdef CONFIG_OWE
/* An array of frequencies to scan for OWE transition mode BSSs when
* owe_transition_search == 1 */
int *owe_trans_scan_freq;
#endif /* CONFIG_OWE */
};