WPS: Clear known_wps_freq in addition to after_wps
authorJouni Malinen <j@w1.fi>
Sun, 27 Oct 2013 10:56:56 +0000 (12:56 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 27 Oct 2013 10:56:56 +0000 (12:56 +0200)
Both of these variables can result in optimized WPS scans, so better
clear these more consistently to avoid unexpected single-channel scans.

Signed-hostap: Jouni Malinen <j@w1.fi>

wpa_supplicant/ctrl_iface.c
wpa_supplicant/wpa_supplicant.c
wpa_supplicant/wps_supplicant.c

index d0c0a01..86e7ece 100644 (file)
@@ -5136,6 +5136,7 @@ static void wpa_supplicant_ctrl_iface_flush(struct wpa_supplicant *wpa_s)
        wpas_wps_cancel(wpa_s);
 #endif /* CONFIG_WPS */
        wpa_s->after_wps = 0;
+       wpa_s->known_wps_freq = 0;
 
 #ifdef CONFIG_TDLS_TESTING
        extern unsigned int tdls_testing;
@@ -5570,6 +5571,7 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
                                wpa_s->normal_scans = 0;
                                wpa_s->scan_req = MANUAL_SCAN_REQ;
                                wpa_s->after_wps = 0;
+                               wpa_s->known_wps_freq = 0;
                                wpa_supplicant_req_scan(wpa_s, 0, 0);
                        } else if (wpa_s->sched_scanning) {
                                wpa_printf(MSG_DEBUG, "Stop ongoing "
index 7fff3a6..255c712 100644 (file)
@@ -671,6 +671,7 @@ void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s,
                wpa_drv_set_supp_port(wpa_s, 1);
 #endif /* IEEE8021X_EAPOL */
                wpa_s->after_wps = 0;
+               wpa_s->known_wps_freq = 0;
 #ifdef CONFIG_P2P
                wpas_p2p_completed(wpa_s);
 #endif /* CONFIG_P2P */
index 0d75464..4c40dac 100644 (file)
@@ -883,6 +883,7 @@ static void wpas_clear_wps(struct wpa_supplicant *wpa_s)
        struct wpa_ssid *ssid, *remove_ssid = NULL, *prev_current;
 
        wpa_s->after_wps = 0;
+       wpa_s->known_wps_freq = 0;
 
        prev_current = wpa_s->current_ssid;