[PATCH 2/5] RRM: Send Radio Measurement response when beacon report scan fails
Andrei Otcheretianski
andrei.otcheretianski at intel.com
Sun Jun 11 05:41:20 PDT 2017
From: Avraham Stern <avraham.stern at intel.com>
When failing to trigger scan for beacon report (e.g., when the
requested duration is not supported by the driver), send a
Radio Measurement response with the mode set to refused and don't
retry the scan.
Signed-off-by: Avraham Stern <avraham.stern at intel.com>
---
wpa_supplicant/rrm.c | 2 +-
wpa_supplicant/scan.c | 7 ++++++-
wpa_supplicant/wpa_supplicant_i.h | 2 +-
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/wpa_supplicant/rrm.c b/wpa_supplicant/rrm.c
index 32c8a06..deb57df 100644
--- a/wpa_supplicant/rrm.c
+++ b/wpa_supplicant/rrm.c
@@ -870,7 +870,7 @@ static void wpas_beacon_rep_table(struct wpa_supplicant *wpa_s,
}
-static void wpas_rrm_refuse_request(struct wpa_supplicant *wpa_s)
+void wpas_rrm_refuse_request(struct wpa_supplicant *wpa_s)
{
if (!is_multicast_ether_addr(wpa_s->rrm.dst_addr)) {
struct wpabuf *buf = NULL;
diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
index 85b732f..62e916a 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -200,7 +200,8 @@ static void wpas_trigger_scan_cb(struct wpa_radio_work *work, int deinit)
wpa_scan_free_params(params);
work->ctx = NULL;
if (ret) {
- int retry = wpa_s->last_scan_req != MANUAL_SCAN_REQ;
+ int retry = wpa_s->last_scan_req != MANUAL_SCAN_REQ &&
+ !wpa_s->beacon_rep_data.token;
if (wpa_s->disconnected)
retry = 0;
@@ -222,6 +223,10 @@ static void wpas_trigger_scan_cb(struct wpa_radio_work *work, int deinit)
/* Clear the scan_res_handler */
wpa_s->scan_res_handler = NULL;
}
+
+ if (wpa_s->beacon_rep_data.token)
+ wpas_rrm_refuse_request(wpa_s);
+
return;
}
diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h
index e5c7272..e792b1a 100644
--- a/wpa_supplicant/wpa_supplicant_i.h
+++ b/wpa_supplicant/wpa_supplicant_i.h
@@ -1283,7 +1283,7 @@ int wpas_beacon_rep_scan_process(struct wpa_supplicant *wpa_s,
struct scan_info *info);
void wpas_clear_beacon_rep_data(struct wpa_supplicant *wpa_s);
void wpas_flush_fils_hlp_req(struct wpa_supplicant *wpa_s);
-
+void wpas_rrm_refuse_request(struct wpa_supplicant *wpa_s);
/* MBO functions */
int wpas_mbo_ie(struct wpa_supplicant *wpa_s, u8 *buf, size_t len);
--
1.9.1
More information about the Hostap
mailing list