[PATCH] NAN: Do not clear NAN NDL state on failure

Andrei Otcheretianski andrei.otcheretianski at intel.com
Tue May 12 23:59:00 PDT 2026


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

When an  NDP response is rejected by the subscriber a NAF with
rejection status needs to be sent to the publisher. Since
in the NDL processing of the NDP rejection, the peer NMI
station is removed and with it the resource allocated to it,
e.g., peer schedule etc., the NAF would be sent on the
general resources of NAN Device and the transmission
can be delayed (or even dropped).

To fix this, when a NAF is expected to be sent to the peer,
do not remove the peer NMI station (it would be removed on
Tx status handling). This way, the NAF would be sent using
the resources allocated to the station.

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

diff --git a/src/nan/nan_ndl.c b/src/nan/nan_ndl.c
index c463f05595..9ee1867e1d 100644
--- a/src/nan/nan_ndl.c
+++ b/src/nan/nan_ndl.c
@@ -736,11 +736,15 @@ out_fail:
 		ndl->status = NAN_NDL_STATUS_REJECTED;
 		ndl->reason = reason;
 		ndl->send_naf_on_error = 1;
+
+		/*
+		 * Do not modify the state. Full cleanup will be done on Tx
+		 * status handling
+		 */
+	} else {
+		nan_ndl_clear(nan, peer);
 	}
 
-	/* Clear the NDL info but leave the state, status, and reason. Full
-	 * cleanup will be done on Tx status handling. */
-	nan_ndl_clear(nan, peer);
 	return -1;
 }
 
-- 
2.53.0




More information about the Hostap mailing list