diff mbox series

NAN: Do not clear NAN NDL state on failure

Message ID 20260513065909.12048-2-andrei.otcheretianski@intel.com
State Accepted
Headers show
Series NAN: Do not clear NAN NDL state on failure | expand

Commit Message

Andrei Otcheretianski May 13, 2026, 6:59 a.m. UTC
From: Ilan Peer <ilan.peer@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@intel.com>
---
 src/nan/nan_ndl.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

Comments

Jouni Malinen May 20, 2026, 9:21 a.m. UTC | #1
On Wed, May 13, 2026 at 09:59:00AM +0300, Andrei Otcheretianski wrote:
> 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.

Thanks, applied.
diff mbox series

Patch

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;
 }