From 1fbff0b5c489379784d344eac0644974b8e4f738 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 11 Aug 2015 21:44:31 +0300 Subject: [PATCH] D-Bus: Set last_scan_req to MANUAL_SCAN_REQ on Scan() trigger paths The D-Bus Scan() handler was setting wpa_s->scan_req = MANUAL_SCAN_REQ on the code path that used wpa_supplicant_req_scan(). However, it did not do anything similar for the cases where wpa_supplicant_trigger_scan() is called directly. This could result in unexpected wpa_s->last_scan_req value and incorrect behavior especially when using ap_scan=2 and running a scan while operating in AP mode. Fix this by explicitly setting wpa_s->last_scan_req = MANUAL_SCAN_REQ when using wpa_supplicant_trigger_scan() from the Scan() handler. Signed-off-by: Jouni Malinen --- wpa_supplicant/dbus/dbus_new_handlers.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wpa_supplicant/dbus/dbus_new_handlers.c b/wpa_supplicant/dbus/dbus_new_handlers.c index 1c04e9280..67562a547 100644 --- a/wpa_supplicant/dbus/dbus_new_handlers.c +++ b/wpa_supplicant/dbus/dbus_new_handlers.c @@ -1341,6 +1341,7 @@ DBusMessage * wpas_dbus_handler_scan(DBusMessage *message, } if (params.freqs && params.freqs[0]) { + wpa_s->last_scan_req = MANUAL_SCAN_REQ; if (wpa_supplicant_trigger_scan(wpa_s, ¶ms)) { reply = wpas_dbus_error_scan_error( @@ -1367,6 +1368,7 @@ DBusMessage * wpas_dbus_handler_scan(DBusMessage *message, wpa_supplicant_cancel_sched_scan(wpa_s); } + wpa_s->last_scan_req = MANUAL_SCAN_REQ; if (wpa_supplicant_trigger_scan(wpa_s, ¶ms)) { reply = wpas_dbus_error_scan_error( message, "Scan request rejected");