]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
RRM: Send Radio Measurement response when beacon report scan fails
authorAvraham Stern <avraham.stern@intel.com>
Sun, 11 Jun 2017 12:41:20 +0000 (15:41 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 17 Jul 2017 14:57:41 +0000 (17:57 +0300)
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@intel.com>
wpa_supplicant/rrm.c
wpa_supplicant/scan.c
wpa_supplicant/wpa_supplicant_i.h

index 12c256cebc5cff15f07559f78f2d2911c295e36c..f1b70c323ec9eb9aa467243852e03c9a24b95e3a 100644 (file)
@@ -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;
index 964adba54e29fe71a767319758116e3a0c5198c1..104b258984a3e9a843dd63667d0a4cb3733928b0 100644 (file)
@@ -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;
        }
 
index db39d1056c930d14ee4db3ba1348ee363a190f65..8b7d2f5c819209a02710b872c15c8e31f975b7dd 100644 (file)
@@ -1317,6 +1317,7 @@ void wpas_rrm_handle_link_measurement_request(struct wpa_supplicant *wpa_s,
                                              const u8 *src,
                                              const u8 *frame, size_t len,
                                              int rssi);
+void wpas_rrm_refuse_request(struct wpa_supplicant *wpa_s);
 int wpas_beacon_rep_scan_process(struct wpa_supplicant *wpa_s,
                                 struct wpa_scan_results *scan_res,
                                 struct scan_info *info);