]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Stop sched_scan in number of cases where it should not be running
authorJouni Malinen <jouni@qca.qualcomm.com>
Mon, 23 Jan 2012 16:26:09 +0000 (18:26 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 23 Jan 2012 16:26:09 +0000 (18:26 +0200)
When a P2P group is removed, we better not leave possibly started
sched_scan running. This could happen when a separate group interface
was not used.

In addition, it looks safer to explicitly stop sched_scan before
starting P2P Listen or Find operations to make sure the offloaded
scanning is not running when doing similar P2P operations.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

wpa_supplicant/events.c
wpa_supplicant/p2p_supplicant.c

index a057880f0508da74f628aeeb26d1ababec56658a..523a2467d054599419121e886bd18c826722d2a7 100644 (file)
@@ -1650,6 +1650,7 @@ static void wpa_supplicant_event_disassoc(struct wpa_supplicant *wpa_s,
                        "try to re-connect");
                wpa_s->reassociate = 0;
                wpa_s->disconnected = 1;
+               wpa_supplicant_cancel_sched_scan(wpa_s);
        }
        bssid = wpa_s->bssid;
        if (is_zero_ether_addr(bssid))
index 8ef35530cba69b649302c93f8016c4a968b72023..e8834ef0766446f3c9659c24a3152589ed7e0833 100644 (file)
@@ -309,6 +309,7 @@ static void wpas_p2p_group_delete(struct wpa_supplicant *wpa_s)
                 */
                wpa_config_remove_network(wpa_s->conf, id);
                wpa_supplicant_clear_status(wpa_s);
+               wpa_supplicant_cancel_sched_scan(wpa_s);
        } else {
                wpa_printf(MSG_DEBUG, "P2P: Temporary group network not "
                           "found");
@@ -3471,6 +3472,8 @@ int wpas_p2p_find(struct wpa_supplicant *wpa_s, unsigned int timeout,
        if (wpa_s->global->p2p_disabled || wpa_s->global->p2p == NULL)
                return -1;
 
+       wpa_supplicant_cancel_sched_scan(wpa_s);
+
        return p2p_find(wpa_s->global->p2p, timeout, type,
                        num_req_dev_types, req_dev_types, dev_id);
 }
@@ -3510,6 +3513,7 @@ int wpas_p2p_listen(struct wpa_supplicant *wpa_s, unsigned int timeout)
        if (wpa_s->global->p2p_disabled || wpa_s->global->p2p == NULL)
                return -1;
 
+       wpa_supplicant_cancel_sched_scan(wpa_s);
        wpas_p2p_clear_pending_action_tx(wpa_s);
 
        if (timeout == 0) {