aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorAvraham Stern <avraham.stern@intel.com>2017-06-11 12:41:21 (GMT)
committerJouni Malinen <j@w1.fi>2017-07-17 15:00:56 (GMT)
commit705e2909c63c838450e0e610a9ace41909c486c8 (patch)
treef5dc1c6ff5a63bc88a6c7e9a2a3b0aaa818f1a8b /wpa_supplicant
parent3756acfd48c0a2547ab2a80ce77f1ca7d70837e4 (diff)
downloadhostap-705e2909c63c838450e0e610a9ace41909c486c8.zip
hostap-705e2909c63c838450e0e610a9ace41909c486c8.tar.gz
hostap-705e2909c63c838450e0e610a9ace41909c486c8.tar.bz2
RRM: Send response when Beacon report request is not supported/refused
Send Radio Measurement response with measurement mode set to reject in the following cases: 1. Reporting conditions is not supported. 2. No valid channels found for the measurement Sending a response with an incapable indication will stop the AP from sending other measurement requests of the same type as specified in IEEE Std 802.11-2016, 11.11.6. Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/rrm.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/wpa_supplicant/rrm.c b/wpa_supplicant/rrm.c
index f1b70c3..55f7f83 100644
--- a/wpa_supplicant/rrm.c
+++ b/wpa_supplicant/rrm.c
@@ -967,7 +967,7 @@ static int wpas_rm_handle_beacon_req_subelem(struct wpa_supplicant *wpa_s,
BEACON_REPORT_DETAIL_ALL_FIELDS_AND_ELEMENTS) {
wpa_printf(MSG_DEBUG, "Invalid reporting detail: %u",
subelem[0]);
- return 0;
+ return -1;
}
break;
@@ -1034,6 +1034,7 @@ wpas_rm_handle_beacon_req(struct wpa_supplicant *wpa_s,
u32 interval_usec;
u32 _rand;
int ret = 0, res;
+ u8 reject_mode;
if (len < sizeof(*req))
return -1;
@@ -1067,9 +1068,12 @@ wpas_rm_handle_beacon_req(struct wpa_supplicant *wpa_s,
res = wpas_rm_handle_beacon_req_subelem(
wpa_s, data, subelems[0], subelems[1], &subelems[2]);
- if (res != 1) {
+ if (res < 0) {
ret = res;
goto out;
+ } else if (!res) {
+ reject_mode = MEASUREMENT_REPORT_MODE_REJECT_INCAPABLE;
+ goto out_reject;
}
elems_len -= 2 + subelems[1];
@@ -1087,7 +1091,8 @@ wpas_rm_handle_beacon_req(struct wpa_supplicant *wpa_s,
req->variable, len - sizeof(*req));
if (!params->freqs) {
wpa_printf(MSG_DEBUG, "Beacon request: No valid channels");
- goto out;
+ reject_mode = MEASUREMENT_REPORT_MODE_REJECT_REFUSED;
+ goto out_reject;
}
params->duration = le_to_host16(req->duration);
@@ -1111,6 +1116,13 @@ wpas_rm_handle_beacon_req(struct wpa_supplicant *wpa_s,
eloop_register_timeout(0, interval_usec, wpas_rrm_scan_timeout, wpa_s,
NULL);
return 1;
+out_reject:
+ if (!is_multicast_ether_addr(wpa_s->rrm.dst_addr) &&
+ wpas_rrm_report_elem(buf, elem_token, reject_mode,
+ MEASURE_TYPE_BEACON, NULL, 0) < 0) {
+ wpa_printf(MSG_DEBUG, "RRM: Failed to add report element");
+ ret = -1;
+ }
out:
wpas_clear_beacon_rep_data(wpa_s);
return ret;