commit 3dc724d734c259d71cf0e16fcbaf2854f060c491
parent ae0ee89d72a7cb0687bc9c14cba2a0b54700d1fe
Author: Denis Kenzior <denkenz@gmail.com>
Date: Wed, 20 Oct 2021 11:49:13 -0500
rrm: Consider requests w/ Beacon Reporting
Normally Beacon Reporting subelements are present only if repeated
measurements are requested. However, an all-zero Beacon Reporting
subelement is included by some implementations. Handle this case
similarly to the absent case.
Diffstat:
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/src/rrm.c b/src/rrm.c
@@ -578,6 +578,11 @@ static void rrm_handle_beacon_request(struct rrm_state *rrm,
detail = l_get_u8(data);
break;
case RRM_BEACON_REQ_SUBELEM_ID_BEACON_REPORTING:
+ if (length < 2) {
+ l_error("Invalid length in Beacon Reporting");
+ goto reject_refused;
+ }
+
/*
* 802.11-2016 9.4.2.21.7
*
@@ -585,9 +590,19 @@ static void rrm_handle_beacon_request(struct rrm_state *rrm,
* present in a Beacon request for repeated
* measurements; otherwise it is not present"
*
- * Since repeated measurements are not supported we can
- * reject this request now.
+ * However, some implementations send an all-zero
+ * Beacon Reporting subelement. Reporting Condition
+ * of zero is 'default, used when the Beacon Reporting
+ * subelement is not included in a Beacon request).'
+ * Treat such elements as if they're not present.
+ *
+ * Otherwise, since repeated measurements are not
+ * supported we can reject this request now.
*/
+ if (l_get_u8(data) != 0)
+ goto reject_incapable;
+
+ break;
case RRM_BEACON_REQ_SUBELEM_ID_AP_CHAN_REPORT:
/*
* Only supporting single channel requests