[PATCH v2 RESEND] hostapd: RNR: skip own BSS by BSSID, not by short SSID

David Lang david at lang.hm
Wed Dec 2 08:38:41 PST 2026


hostapd_eid_nr_db_len() and hostapd_eid_nr_db() skip every neighbor
database entry whose short SSID matches the reporting BSS, meaning to
skip only the BSS's own entry (added by
hostapd_neighbor_set_own_report). That also drops every same-ESS
neighbor AP from the Reduced Neighbor Report (beacon IE 201), which
are the entries that matter for roaming. Skip only the entry whose
BSSID equals hapd->own_addr. This is the same check that is done for
the Neighbor Report.

Signed-off-by: David Lang <david at lang.hm>
---
RESEND: the first copy of v2 was mangled by my mail client (format=flowed);
same patch, sent with git send-email.
v2: shortened the code comment per review and moved the explanation
into the commit message. Use the same ether_addr_equal() argument
order as the Neighbor Report check.

 src/ap/ieee802_11.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
index e4caac085..784af3002 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -11324,7 +11324,8 @@ static size_t hostapd_eid_nr_db_len(struct hostapd_data *hapd,
 		if (!nr->nr || wpabuf_len(nr->nr) < 12)
 			continue;
 
-		if (nr->short_ssid == hapd->conf->ssid.short_ssid)
+		/* Skip the reporting BSS's own entry */
+		if (ether_addr_equal(hapd->own_addr, nr->bssid))
 			continue;
 
 		/* Start a new element */
@@ -11793,7 +11794,8 @@ static u8 * hostapd_eid_nr_db(struct hostapd_data *hapd, u8 *eid,
 		if (!nr->nr || wpabuf_len(nr->nr) < 12)
 			continue;
 
-		if (nr->short_ssid == hapd->conf->ssid.short_ssid)
+		/* Skip the reporting BSS's own entry */
+		if (ether_addr_equal(hapd->own_addr, nr->bssid))
 			continue;
 
 		/* Start a new element */
-- 
2.47.3




More information about the Hostap mailing list