[PATCH 07/97] NAN: Send NAF with rejection on schedule validation error
Andrei Otcheretianski
andrei.otcheretianski at intel.com
Tue Apr 28 13:05:08 PDT 2026
Previously, if NDP request wasn't valid, the publisher wouldn't respond
at all and silently ignore the request. This is incorrect, as the spec
requires to explicitly send NAF response with "reject" status and a
corresponding reason code for invalid NDL cases. Otherwise, the
subscriber can only rely on internal timeouts.
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski at intel.com>
---
src/nan/nan.c | 11 ++++++++++-
src/nan/nan_ndl.c | 8 ++++++--
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/src/nan/nan.c b/src/nan/nan.c
index f06d37cb63..52db635a96 100644
--- a/src/nan/nan.c
+++ b/src/nan/nan.c
@@ -1549,7 +1549,16 @@ static int nan_action_rx_ndp(struct nan_data *nan, struct nan_peer *peer,
return -1;
}
- nan_ndp_action_notif(nan, peer);
+ if (peer->ndl->status == NAN_NDL_STATUS_REJECTED) {
+ nan_ndp_setup_failure(nan, peer,
+ NAN_REASON_NDL_UNACCEPTABLE,
+ false);
+ if (peer->ndl->send_naf_on_error)
+ nan_action_send(nan, peer, resp_oui);
+ nan_ndp_setup_stop(nan, peer);
+ } else {
+ nan_ndp_action_notif(nan, peer);
+ }
return 0;
}
diff --git a/src/nan/nan_ndl.c b/src/nan/nan_ndl.c
index 1f7bd4f1ad..8ab9907737 100644
--- a/src/nan/nan_ndl.c
+++ b/src/nan/nan_ndl.c
@@ -211,6 +211,7 @@ static bool nan_ndl_validate_peer_avail(struct nan_data *nan,
if (!ret) {
wpa_printf(MSG_DEBUG,
"NAN: Peer avail: Immutable is not covered by avail");
+ peer->ndl->reason = NAN_REASON_IMMUTABLE_UNACCEPTABLE;
return ret;
}
@@ -221,6 +222,7 @@ static bool nan_ndl_validate_peer_avail(struct nan_data *nan,
if (!ret) {
wpa_printf(MSG_DEBUG,
"NAN: Peer avail: NDC is not covered by avail");
+ peer->ndl->reason = NAN_REASON_NDL_UNACCEPTABLE;
return ret;
}
@@ -883,8 +885,10 @@ static int nan_ndl_attr_handle_req(struct nan_data *nan, struct nan_peer *peer,
}
ret = nan_ndl_validate_peer_avail(nan, peer);
- if (!ret)
- goto fail;
+ if (!ret) {
+ ndl->status = NAN_NDL_STATUS_REJECTED;
+ ndl->send_naf_on_error = 1;
+ }
nan_ndl_set_state(nan, ndl, NAN_NDL_STATE_REQ_RECV);
--
2.53.0
More information about the Hostap
mailing list