From 6a504cc66c001640ac1d976b3da726285eab520a Mon Sep 17 00:00:00 2001 In-Reply-To: <7650efac-5f0a-4820-9aca-55b3944c7d9e@freebox.fr> From: David Lang Date: Wed, 2 Dec 2026 09:14:27 -0700 Subject: [PATCH v2] hostapd: RNR: skip own BSS by BSSID, not by short SSID 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 --- 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