[PATCH v2] hostapd: Only send own Neighbor Report when requested

Tim Small tim at seoss.co.uk
Fri Sep 18 09:32:25 PDT 2026


Every known Neighbor Report that matches the requested SSID is sent in the
Neighbor Report Response, including a report for the sending BSSID itself.
According to IEEE 802.11-2024 (11.10.10.3), a neighbor report for the
sending BSSID need only be included when the request includes an LCI or
Location Civic Measurement Request.

Signed-off-by: Pablo Martin-Gomez <pmartin-gomez at freebox.fr>
[tim at seoss.co.uk: commit message reworded, checked vs 802.11-2024 spec]
Signed-off-by: Tim Small <tim at seoss.co.uk>
Tested-By: Tim Small <tim at seoss.co.uk>
---

Notes:
    I've tested this patch against OpenWrt 25.12 for a couple of months at
    two small sites (9 physical access points Mediatek Filogic 820, with
    and around 70 mixed client devices running Linux, MacOS, iOS, Android,
    Windows, misc IoT) without problems.
    
    I've reworded the commit message, but the code is unchanged from
    Pablo's original patch.
    
    I've checked that main compiles and passes tests with it applied, but
    I have only tested it with real hardware and clients using the hostap
    version which ships with OpenWrt 25.12.

 src/ap/rrm.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/ap/rrm.c b/src/ap/rrm.c
index 73771e4c5..58990dc5f 100644
--- a/src/ap/rrm.c
+++ b/src/ap/rrm.c
@@ -227,6 +227,10 @@ static void hostapd_send_nei_report_resp(struct hostapd_data *hapd,
 		    os_memcmp(ssid->ssid, nr->ssid.ssid, ssid->ssid_len) != 0)
 			continue;
 
+		/* Only send own report if Measurement Type is LCI or Location Civic. */
+		if (!civic && !lci && os_memcmp(hapd->own_addr, nr->bssid, ETH_ALEN) == 0)
+			continue;
+
 		send_lci = (lci != 0) && hostapd_check_lci_age(nr, lci_max_age);
 		len = hostapd_neighbor_report_len(buf, nr, send_lci, civic);
 
-- 
2.47.3




More information about the Hostap mailing list