[PATCH 34/71] NAN: Parse device attributes from SDF frames

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


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

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

diff --git a/src/nan/nan.c b/src/nan/nan.c
index 899ecb6662..f202f97b89 100644
--- a/src/nan/nan.c
+++ b/src/nan/nan.c
@@ -1064,7 +1064,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");
@@ -1080,6 +1079,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;
 }
@@ -1465,14 +1466,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 attributes");
-		goto done;
-	}
-
 	switch (msg.oui_subtype) {
 	case NAN_SUBTYPE_DATA_PATH_REQUEST:
 		resp_oui = NAN_SUBTYPE_DATA_PATH_RESPONSE;
-- 
2.53.0




More information about the Hostap mailing list