[RFC 43/56] NAN: Add security support in NAF transmit flow

Andrei Otcheretianski andrei.otcheretianski at intel.com
Sun Dec 7 03:18:52 PST 2025


From: Ilan Peer <ilan.peer at intel.com>

1. Add NAN security attributes when needed.
2. Perform pre-Tx frames processing based on the current
   state of the NDP state machine and frame subtype.

Signed-off-by: Ilan Peer <ilan.peer at intel.com>
---
 src/nan/nan.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/nan/nan.c b/src/nan/nan.c
index 1ed75c20e5..031839be17 100644
--- a/src/nan/nan.c
+++ b/src/nan/nan.c
@@ -1062,6 +1062,10 @@ static int nan_action_build(struct nan_data *nan, struct nan_peer *peer,
 	if (ret)
 		return ret;
 
+	ret = nan_sec_add_attrs(nan, peer, subtype, buf);
+	if (ret)
+		return ret;
+
 	ret = nan_ndl_add_avail_attrs(nan, peer, buf);
 	if (ret)
 		return ret;
@@ -1100,6 +1104,10 @@ static int nan_action_send(struct nan_data *nan, struct nan_peer *peer,
 	if (ret)
 		goto out;
 
+	ret = nan_sec_pre_tx(nan, peer, buf);
+	if (ret)
+		goto out;
+
 	ret = nan->cfg->send_naf(nan->cfg->cb_ctx, peer->nmi_addr, NULL,
 				 nan->cluster_id, buf);
 
-- 
2.49.0




More information about the Hostap mailing list