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 <j@w1.fi>
This commit is contained in:
Jouni Malinen 2015-08-11 21:44:31 +03:00
parent fbcddaed9a
commit 1fbff0b5c4

View file

@ -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,
&params)) {
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, &params)) {
reply = wpas_dbus_error_scan_error(
message, "Scan request rejected");