On Fri, Dec 13, 2024 at 02:15:27PM +0530, Vinayak Yadawad wrote: > Currently STA roam works fine in case of OWE only AP to > OWE-transition mode AP. The roam fails when STA is connected > in OWE mode with OWE transition AP to an OWE only AP. In the > OWE transition case, the current_ssid stores only open network > SSID, specific check is required to compare the OWE BSS ssid > from the previous target and new target. The change in owe_trans_ssid() is a clear fix to a recent regression, so I applied that separately. As far as the changes in wpa_supplicant_select_config() are concerned, I'm not completely sure I understood them since the comment about the added OWE transition mode AP to OWE-only AP comparison of the SSID does not seem to match what I would have expected from the actual memcmp(). The SSID of the previous BSS (i.e., the transition mode AP) is a random value that does not match the network profile whereas the SSID of the selected BSS (i.e., OWE-only AP) is the SSID of the network profile. Those are different and as such, the new memcmp() == 0 case would not be met.. Would you be able to share a debug log showing what fails without this patch? I did some cleanup while reviewing and trying to understand this and this is what I came up with while still not fully understanding what this trying to do: From: Vinayak Yadawad <vinayak.yadawad@xxxxxxxxxxxx> Date: Fri, 13 Dec 2024 14:15:27 +0530 Subject: [PATCH] OWE: Allow roam from OWE transition mode AP to OWE-only AP Currently STA roam works fine in case of OWE only AP to OWE-transition mode AP. The roam fails when STA is connected in OWE mode with OWE transition AP to an OWE only AP. In the OWE transition case, the current_ssid stores only open network SSID, specific check is required to compare the OWE BSS ssid from the previous target and new target. Signed-off-by: Vinayak Yadawad <vinayak.yadawad@xxxxxxxxxxxx> --- wpa_supplicant/events.c | 38 ++++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index 279838afa2bf..e7285fcb5cea 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -226,6 +226,15 @@ static int wpa_supplicant_select_config(struct wpa_supplicant *wpa_s, int res; if (wpa_s->conf->ap_scan == 1 && wpa_s->current_ssid) { +#ifdef CONFIG_OWE + struct wpa_bss *prev_bss; + + /* Remember the current BSS entry before update to a new one to + * allow appropriate comparison in OWE transition mode cases + * below. */ + prev_bss = wpa_s->current_bss; +#endif /* CONFIG_OWE */ + wpa_supplicant_update_current_bss(wpa_s, wpa_s->bssid); if (wpa_s->current_ssid->ssid_len == 0) @@ -245,12 +254,29 @@ static int wpa_supplicant_select_config(struct wpa_supplicant *wpa_s, #ifdef CONFIG_OWE if ((wpa_s->current_ssid->key_mgmt & WPA_KEY_MGMT_OWE) && - wpa_s->current_bss && - (wpa_s->current_bss->flags & WPA_BSS_OWE_TRANSITION) && - drv_ssid_len == wpa_s->current_bss->ssid_len && - os_memcmp(drv_ssid, wpa_s->current_bss->ssid, - drv_ssid_len) == 0) - return 0; /* current profile still in use */ + wpa_s->current_bss) { + /* Handle the case where the selected BSS uses OWE + * transition mode */ + if ((wpa_s->current_bss->flags & + WPA_BSS_OWE_TRANSITION) && + drv_ssid_len == wpa_s->current_bss->ssid_len && + os_memcmp(drv_ssid, wpa_s->current_bss->ssid, + drv_ssid_len) == 0) + return 0; /* current profile still in use */ + + /* Handle the case where the selected BSS uses OWE-only + * mode and the previous one uses OWE transition mode. + * The connected SSID would be that of the OWE network + * where as current_ssid stores the open network SSID. + */ + if (prev_bss && + (prev_bss->flags & WPA_BSS_OWE_TRANSITION) && + (prev_bss->ssid_len == + wpa_s->current_bss->ssid_len) && + os_memcmp(prev_bss->ssid, wpa_s->current_bss->ssid, + wpa_s->current_bss->ssid_len) == 0) + return 0; /* current profile still in use */ + } #endif /* CONFIG_OWE */ wpa_msg(wpa_s, MSG_DEBUG, -- 2.43.0 -- Jouni Malinen PGP id EFC895FA _______________________________________________ Hostap mailing list Hostap@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/hostap