[RFC 24/30] SMD: Use event link info and notify when the transition is done

Ilan Peer ilan.peer at intel.com
Wed Oct 21 06:43:42 PDT 2026


When the ST Exec Status is received, update the AP MLD address
and the per-link BSSID, address and BSS entries directly from the
event data, instead of querying the driver with
wpa_drv_get_mlo_info(). The driver might not have the updated link
state yet at this point, so the WPA SM is then synced from the
updated wpa_supplicant state using wpas_sm_set_ml_info_from_wpa_s().

In addition, send a CTRL-EVENT-SMD-TRANSITION-DONE event with the
target AP MLD address when the ST is done, to notify higher layers
that the STA is now connected to the target AP MLD.

Signed-off-by: Ilan Peer <ilan.peer at intel.com>
---
 src/common/wpa_ctrl.h |  2 ++
 wpa_supplicant/smd.c  | 34 +++++++++++++++++++++++-----------
 2 files changed, 25 insertions(+), 11 deletions(-)

diff --git a/src/common/wpa_ctrl.h b/src/common/wpa_ctrl.h
index ae93e1e4ef88..18f0390510b4 100644
--- a/src/common/wpa_ctrl.h
+++ b/src/common/wpa_ctrl.h
@@ -32,6 +32,8 @@ extern "C" {
 #define WPA_EVENT_ASSOC_REJECT "CTRL-EVENT-ASSOC-REJECT "
 /** Authentication rejected during connection attempt */
 #define WPA_EVENT_AUTH_REJECT "CTRL-EVENT-AUTH-REJECT "
+/** SMD Transition completed and the STA is connected to the target AP MLD */
+#define WPA_EVENT_SMD_TRANSITION_DONE "CTRL-EVENT-SMD-TRANSITION-DONE "
 /** wpa_supplicant is exiting */
 #define WPA_EVENT_TERMINATING "CTRL-EVENT-TERMINATING "
 /** Password change was completed successfully */
diff --git a/wpa_supplicant/smd.c b/wpa_supplicant/smd.c
index 53a115934ddc..709e270cd210 100644
--- a/wpa_supplicant/smd.c
+++ b/wpa_supplicant/smd.c
@@ -8,6 +8,7 @@
 
 #include "includes.h"
 #include "common.h"
+#include "common/wpa_ctrl.h"
 #include "wpa_supplicant_i.h"
 #include "driver_i.h"
 #include "bss.h"
@@ -426,6 +427,7 @@ void wpas_smd_st_exec_status(struct wpa_supplicant *wpa_s,
 	size_t len = info->resp_frame_len;
 	const u8 *pos;
 	u16 status;
+	int i;
 
 	wpa_printf(MSG_DEBUG, "SMD: ST Exec Status (ap_mld=" MACSTR ")",
 		   MAC2STR(info->ap_mld_addr));
@@ -508,18 +510,25 @@ void wpas_smd_st_exec_status(struct wpa_supplicant *wpa_s,
 	}
 
 	/*
-	 * Update wpa_supplicant state and WPA SM with the target AP MLD
-	 * information before installing group keys. The ST moves the
-	 * connection to a new AP MLD, so the AP MLD address and per-link
-	 * information must be updated accordingly.
-	 *
-	 * TODO: This is currently relying on MLD flows, that might not be
-	 * the case for ST.
+	 * Update wpa_supplicant state with the target AP MLD information
+	 * from the event data before installing group keys. The driver
+	 * might not have the updated link state yet at this point, so
+	 * use the link information carried in the event directly.
 	 */
-	if (wpa_drv_get_mlo_info(wpa_s) < 0) {
-		wpa_printf(MSG_DEBUG,
-			   "SMD: Failed to get MLO info for target AP");
-		goto fail;
+	wpa_s->valid_links = info->links;
+	os_memcpy(wpa_s->ap_mld_addr, info->ap_mld_addr, ETH_ALEN);
+	for (i = 0; i < MAX_NUM_MLD_LINKS; i++) {
+		struct wpa_bss *bss;
+
+		if (!(info->links & BIT(i)))
+			continue;
+		os_memcpy(wpa_s->links[i].bssid,
+			  info->link_info[i].bssid, ETH_ALEN);
+		os_memcpy(wpa_s->links[i].addr,
+			  info->link_info[i].addr, ETH_ALEN);
+		bss = wpa_bss_get_bssid(wpa_s, info->link_info[i].bssid);
+		if (bss)
+			wpa_s->links[i].bss = bss;
 	}
 
 	if (wpas_sm_set_ml_info_from_wpa_s(wpa_s)) {
@@ -588,6 +597,9 @@ void wpas_smd_st_done(struct wpa_supplicant *wpa_s,
 			   i, MAC2STR(info->links[i].bssid));
 	}
 
+	wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_SMD_TRANSITION_DONE "ap_mld=" MACSTR,
+		MAC2STR(info->ap_mld_addr));
+
 	wpas_smd_reset(wpa_s);
 }
 
-- 
2.55.0




More information about the Hostap mailing list