[RFC v2 89/99] NAN: Parse device attributes from SDF frames

Andrei Otcheretianski andrei.otcheretianski at intel.com
Tue Dec 23 03:52:33 PST 2025


Device attributes were not parsed for SDF frames. Implement it.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski at intel.com>
---
 src/nan/nan.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/src/nan/nan.c b/src/nan/nan.c
index 44eaa992b2..ee95a10661 100644
--- a/src/nan/nan.c
+++ b/src/nan/nan.c
@@ -1030,7 +1030,6 @@ int nan_add_peer(struct nan_data *nan, const u8 *addr,
 	if (!nan)
 		return -1;
 
-	/* TODO: parse the device attributes to update the peer information */
 	if (!device_attrs || !device_attrs_len) {
 		wpa_printf(MSG_DEBUG,
 			   "NAN: Ignore add_peer with no device attributes");
@@ -1046,6 +1045,8 @@ int nan_add_peer(struct nan_data *nan, const u8 *addr,
 		os_memcpy(peer->nmi_addr, addr, ETH_ALEN);
 	}
 
+	nan_parse_device_attrs(nan, peer, device_attrs, device_attrs_len);
+
 	os_get_reltime(&peer->last_seen);
 	return 0;
 }
@@ -1431,15 +1432,6 @@ int nan_action_rx(struct nan_data *nan, const struct ieee80211_mgmt *mgmt,
 
 	wpa_printf(MSG_DEBUG, "NAN: NAF: oui_subtype=%u", msg.oui_subtype);
 
-	ret = nan_parse_device_attrs(nan, peer,
-				     mgmt->u.action.u.naf.variable,
-				     len - IEEE80211_MIN_ACTION_LEN(naf));
-	if (ret) {
-		wpa_printf(MSG_DEBUG,
-			   "NAN: NAF: Failed to parse device attrs");
-		goto done;
-	}
-
 	switch (msg.oui_subtype) {
 	case NAN_SUBTYPE_DATA_PATH_REQUEST:
 		resp_oui = NAN_SUBTYPE_DATA_PATH_RESPONSE;
-- 
2.49.0




More information about the Hostap mailing list