]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Clear scan_res_handler on no-retry failure
authorHu Wang <huw@qti.qualcomm.com>
Wed, 1 Mar 2017 14:39:30 +0000 (16:39 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 1 Mar 2017 14:39:30 +0000 (16:39 +0200)
Previously it was possible for wpa_s->scan_res_handler to remain set to
its old value in case wpa_drv_scan() failed and no retry for the scan
trigger was scheduled (i.e., when last_scan_req == MANUAL_SCAN_REQ).
This could result in getting stuck with the next connection attempt
after a failed "SCAN TYPE=ONLY" operation when wpa_s->scan_res_handler
was set to scan_only_handler().

Fix this by clearing wpa_s->scan_res_handler if wpa_drv_scan() fails and
no retry is scheduled.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
wpa_supplicant/scan.c

index f3ff4cdd828b65d675547e4feef45801d02c532a..f59f5e860f5a48324afe97516202ea1473c94864 100644 (file)
@@ -208,6 +208,9 @@ static void wpas_trigger_scan_cb(struct wpa_radio_work *work, int deinit)
                        /* Restore scan_req since we will try to scan again */
                        wpa_s->scan_req = wpa_s->last_scan_req;
                        wpa_supplicant_req_scan(wpa_s, 1, 0);
+               } else if (wpa_s->scan_res_handler) {
+                       /* Clear the scan_res_handler */
+                       wpa_s->scan_res_handler = NULL;
                }
                return;
        }