path: root/wpa_supplicant/events.c
diff options
authorJouni Malinen <jouni@qca.qualcomm.com>2012-09-24 10:46:27 (GMT)
committerJouni Malinen <j@w1.fi>2012-09-24 10:46:27 (GMT)
commit4c490780e2a08017fe90911f3bdcd24a372bee3c (patch)
tree6e09740da70d193965e4a8013ce4a7e57b1aad00 /wpa_supplicant/events.c
parentac06fb12f58398f7cf715a2e0b6cc84512fb6e41 (diff)
P2P: Fix pending-sta-scan processing for concurrent operation cases
If two P2P_FIND commands and a station mode SCAN command are issued in a sequence with the second P2P_FIND and SCAN commands started before the initial scan from the first P2P_FIND command has completed, sta_scan_pending may be left set without an automatic way of getting it cleared. This can get P2P search stuck if no further station mode scan operations are run. Fix this by clearing the sta_scan_pending flag whenever station mode scans are stopped due to no enabled networks resulting in INACTIVE mode getting entered. In addition, avoid setting sta_scan_pending flag when a special scan_res_handler is set so that this does not get enabled on the P2P Device interface during a P2P search operation. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wpa_supplicant/events.c')
1 files changed, 5 insertions, 1 deletions
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index e245d4a..d696ad1 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -854,6 +854,9 @@ static void wpa_supplicant_req_new_scan(struct wpa_supplicant *wpa_s,
wpa_dbg(wpa_s, MSG_DEBUG, "Short-circuit new scan request "
"since there are no enabled networks");
wpa_supplicant_set_state(wpa_s, WPA_INACTIVE);
+#ifdef CONFIG_P2P
+ wpa_s->sta_scan_pending = 0;
+#endif /* CONFIG_P2P */
wpa_supplicant_req_scan(wpa_s, timeout_sec, timeout_usec);
@@ -1053,7 +1056,8 @@ static int _wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
#ifdef CONFIG_P2P
if (wpa_s->global->p2p_cb_on_scan_complete &&
!wpa_s->global->p2p_disabled &&
- wpa_s->global->p2p != NULL && !wpa_s->sta_scan_pending) {
+ wpa_s->global->p2p != NULL && !wpa_s->sta_scan_pending &&
+ !wpa_s->scan_res_handler) {
wpa_s->global->p2p_cb_on_scan_complete = 0;
if (p2p_other_scan_completed(wpa_s->global->p2p) == 1) {
wpa_dbg(wpa_s, MSG_DEBUG, "P2P: Pending P2P operation "