[PATCH 40/71] NAN: Indicate if new keys are derived or previous NDP exists

Andrei Otcheretianski andrei.otcheretianski at intel.com
Wed Apr 1 15:01:49 PDT 2026


Extend nan_ndp_connection_params struct to indicate whether new keys
were derived and whether this is the first NDP established with the
peer.
This is needed by wpa_supplicant to skip STA capabilities and keys
configuration accordingly.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski at intel.com>
---
 src/nan/nan.c | 6 ++++--
 src/nan/nan.h | 4 ++++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/nan/nan.c b/src/nan/nan.c
index 487e5a8ba5..066a529638 100644
--- a/src/nan/nan.c
+++ b/src/nan/nan.c
@@ -1335,8 +1335,10 @@ static int nan_ndp_connected(struct nan_data *nan, struct nan_peer *peer)
 		params.peer_ndi = peer->ndp_setup.ndp->init_ndi;
 	}
 
-	nan_sec_ndp_store_keys(nan, peer, params.peer_ndi, params.local_ndi);
-
+	params.install_keys = nan_sec_ndp_store_keys(nan, peer,
+						     params.peer_ndi,
+						     params.local_ndi);
+	params.first_ndp = dl_list_empty(&peer->ndps);
 	if (nan->cfg->ndp_connected &&
 	    nan->cfg->ndp_connected(nan->cfg->cb_ctx, &params)) {
 		wpa_printf(MSG_DEBUG,
diff --git a/src/nan/nan.h b/src/nan/nan.h
index d78c8fa264..44072216d8 100644
--- a/src/nan/nan.h
+++ b/src/nan/nan.h
@@ -279,6 +279,8 @@ struct nan_channels {
  * @local_ndi: Local NDI MAC address
  * @ssi: Service specific information
  * @ssi_len: Service specific information length
+ * @install_keys: Whether the new keys should be installed
+ * @first_ndp: Whether this is the first NDP with the peer
  */
 struct nan_ndp_connection_params {
 	struct nan_ndp_id ndp_id;
@@ -286,6 +288,8 @@ struct nan_ndp_connection_params {
 	const u8 *local_ndi;
 	const u8 *ssi;
 	size_t ssi_len;
+	bool install_keys;
+	bool first_ndp;
 };
 
 /**
-- 
2.53.0




More information about the Hostap mailing list