diff mbox series

hostapd: send own Neighbor Report only if specific Measurement Request

Message ID 3c483f83-ca86-40b3-842b-cbb6f0e5d1ca@freebox.fr
State New
Headers show
Series hostapd: send own Neighbor Report only if specific Measurement Request | expand

Commit Message

Pablo MG May 21, 2025, 4:06 p.m. UTC
Every Neighbor Report that matches the requested SSID is sent in the
Neighbor Report Response, including our own report. According to standard
IEEE 802.11-2020 (11.10.10.3), the self report should not be included in
the response unless the request includes a LCI Measurement Request or a
Location Civic Measurement Request.

Signed-off-by: Pablo Martin-Gomez <pmartin-gomez@freebox.fr>
---
  src/ap/rrm.c | 4 ++++
  1 file changed, 4 insertions(+)

          send_lci = (lci != 0) && hostapd_check_lci_age(nr, lci_max_age);
          len = hostapd_neighbor_report_len(buf, nr, send_lci, civic);

Comments

David Bauer May 29, 2025, 11 a.m. UTC | #1
Hi Pablo,

On 5/21/25 18:06, Pablo MARTIN-GOMEZ wrote:
> Every Neighbor Report that matches the requested SSID is sent in the
> Neighbor Report Response, including our own report. According to standard
> IEEE 802.11-2020 (11.10.10.3), the self report should not be included in
> the response unless the request includes a LCI Measurement Request or a
> Location Civic Measurement Request.

I read the standard as a "can not have" not a "should not"

> [...] then the AP shall include a Neighbor Report element for the AP’s
> own BSSID in the Neighbor Report Response frame [...]

I think the change is correct and should be applied, I'm just a bit
confused with the description.

If i missed the part where it stated "should not contain", please
correct me.

Best
David

> 
> Signed-off-by: Pablo Martin-Gomez <pmartin-gomez@freebox.fr>
> ---
>   src/ap/rrm.c | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/src/ap/rrm.c b/src/ap/rrm.c
> index fbcddf3f9..0fdda9958 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);
>
Pablo MG June 2, 2025, 10:08 a.m. UTC | #2
Hi David,
On 29/05/2025 13:00, David Bauer wrote:
> Hi Pablo,
>
> On 5/21/25 18:06, Pablo MARTIN-GOMEZ wrote:
>> Every Neighbor Report that matches the requested SSID is sent in the
>> Neighbor Report Response, including our own report. According to 
>> standard
>> IEEE 802.11-2020 (11.10.10.3), the self report should not be included in
>> the response unless the request includes a LCI Measurement Request or a
>> Location Civic Measurement Request.
>
> I read the standard as a "can not have" not a "should not"
>
>> [...] then the AP shall include a Neighbor Report element for the AP’s
>> own BSSID in the Neighbor Report Response frame [...]
>
> I think the change is correct and should be applied, I'm just a bit
> confused with the description.
>
> If i missed the part where it stated "should not contain", please
> correct me.

To be honest, I find the standard to be unclear on that point. It's 
clear when the self Neighbor Report has to be included but outside of 
those conditions, the standard has no "shall not include" so I sort of 
deduced from the "spirit" of the standard that the self Neighbor Report 
is not expected to be included otherwise .

One could even claim that:

 > NOTE—The Neighbor Report Response frame includes a list of Neighbor 
Report elements one for each neighbor. The
 > criteria for the selection of an AP as a neighbor AP is beyond the 
scope of this specification.

can be interpreted as an implementer is free to consider an AP as its 
own neighbor AP and therefor send a self Neighbor Report by default. So 
I'm not even sure about the "spirit" of the standard.

>
> Best
> David

Best regards,

Pablo
diff mbox series

Patch

diff --git a/src/ap/rrm.c b/src/ap/rrm.c
index fbcddf3f9..0fdda9958 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;
+