[PATCH 1/1] hostapd: Allow roam from OWE transition to OWE only AP

Vinayak Yadawad vinayak.yadawad at broadcom.com
Fri Dec 13 00:45:27 PST 2024


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 at broadcom.com>
---
 wpa_supplicant/events.c | 35 ++++++++++++++++++++++++++++-------
 1 file changed, 28 insertions(+), 7 deletions(-)

diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index a7c56f771..8c0adae0d 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -221,11 +221,19 @@ static int wpa_supplicant_select_config(struct wpa_supplicant *wpa_s,
 {
 	struct wpa_ssid *ssid, *old_ssid;
 	struct wpa_bss *bss;
+#ifdef CONFIG_OWE
+	struct wpa_bss *prev_bss;
+#endif /* CONFIG_OWE */
 	u8 drv_ssid[SSID_MAX_LEN];
 	size_t drv_ssid_len;
 	int res;
 
 	if (wpa_s->conf->ap_scan == 1 && wpa_s->current_ssid) {
+#ifdef CONFIG_OWE
+		/* Store the current bss before updating new bss */
+		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 +253,25 @@ 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) {
+			/* current bss is of OWE transition */
+			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 */
+
+			/*
+			 * OWE transition network to OWE only network. The connected
+			 * SSID would be that of 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,
@@ -1162,7 +1183,7 @@ static void owe_trans_ssid(struct wpa_supplicant *wpa_s, struct wpa_bss *bss,
 			if (wpas_network_disabled(wpa_s, ssid))
 				continue;
 			if (ssid->ssid_len == *ret_ssid_len &&
-			    os_memcmp(ssid->ssid, ret_ssid, *ret_ssid_len) == 0) {
+			    os_memcmp(ssid->ssid, *ret_ssid, *ret_ssid_len) == 0) {
 				/* OWE BSS in transition mode for a currently
 				 * enabled OWE network. */
 				wpa_dbg(wpa_s, MSG_DEBUG,
-- 
2.43.4




More information about the Hostap mailing list