[RFC 12/30] WPA: Add support for configuring SMD state

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


Add support for setting SMD state to the WPA state
machine.

Signed-off-by: Ilan Peer <ilan.peer at intel.com>
---
 src/rsn_supp/wpa.c              | 3 +++
 src/rsn_supp/wpa.h              | 1 +
 src/rsn_supp/wpa_i.h            | 1 +
 wpa_supplicant/wpa_supplicant.c | 8 ++++++++
 4 files changed, 13 insertions(+)

diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c
index c8f5d359af8b..430d5713d6bf 100644
--- a/src/rsn_supp/wpa.c
+++ b/src/rsn_supp/wpa.c
@@ -5317,6 +5317,9 @@ int wpa_sm_set_param(struct wpa_sm *sm, enum wpa_sm_conf_params param,
 	case WPA_PARAM_SECURITY_PROFILE_ACTIVE:
 		sm->security_profile_active = !!value;
 		break;
+	case WPA_PARAM_SMD:
+		sm->smd = !!value;
+		break;
 	default:
 		break;
 	}
diff --git a/src/rsn_supp/wpa.h b/src/rsn_supp/wpa.h
index c61ca16a461a..056296582c2f 100644
--- a/src/rsn_supp/wpa.h
+++ b/src/rsn_supp/wpa.h
@@ -148,6 +148,7 @@ enum wpa_sm_conf_params {
 	WPA_PARAM_ASSOC_ENC,
 	WPA_PARAM_PMKSA_CACHING_PRIVACY,
 	WPA_PARAM_SECURITY_PROFILE_ACTIVE,
+	WPA_PARAM_SMD,
 };
 
 enum wpa_rsn_override {
diff --git a/src/rsn_supp/wpa_i.h b/src/rsn_supp/wpa_i.h
index 72b26d1d9e29..a4fde79e7d05 100644
--- a/src/rsn_supp/wpa_i.h
+++ b/src/rsn_supp/wpa_i.h
@@ -120,6 +120,7 @@ struct wpa_sm {
 	unsigned int assoc_encryption:1;
 	unsigned int pmksa_privacy:1;
 	unsigned int eap_over_auth_frame:1;
+	unsigned int smd:1;
 
 	/*
 	 * Security Profile element state (IEEE P802.11bn/D2.0, 9.4.2.369,
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index bf577e0d5ae2..c467ed02ebd2 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -460,6 +460,7 @@ void wpa_supplicant_set_non_wpa_policy(struct wpa_supplicant *wpa_s,
 			 wpa_s->mgmt_group_cipher);
 	wpa_sm_set_param(wpa_s->wpa, WPA_PARAM_SSID_PROTECTION, 0);
 	wpa_sm_set_param(wpa_s->wpa, WPA_PARAM_ASSOC_ENC, 0);
+	wpa_sm_set_param(wpa_s->wpa, WPA_PARAM_SMD, 0);
 
 	pmksa_cache_clear_current(wpa_s->wpa);
 	os_memset(&mlo, 0, sizeof(mlo));
@@ -2756,6 +2757,8 @@ int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s,
 		wpa_sm_set_param(wpa_s->wpa, WPA_PARAM_SSID_PROTECTION, false);
 	}
 
+	wpa_sm_set_param(wpa_s->wpa, WPA_PARAM_SMD, false);
+
 #ifdef CONFIG_ENC_ASSOC
 	if (proto == WPA_PROTO_RSN &&
 	    (wpa_s->drv_flags2 &
@@ -2805,6 +2808,11 @@ int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s,
 			 ssid->pmksa_privacy || ssid->security_profiles);
 #endif /* CONFIG_PMKSA_PRIVACY */
 
+	wpa_sm_set_param(wpa_s->wpa,
+			 WPA_PARAM_SMD,
+			 !!(wpa_s->drv_flags2 &
+				   WPA_DRIVER_FLAGS2_SMD_STA_SUPPORT));
+
 	wpa_sm_set_param(wpa_s->wpa, WPA_PARAM_SECURITY_PROFILE_ACTIVE, false);
 
 	/*
-- 
2.55.0




More information about the Hostap mailing list