WPS: Clear after_wps from number of new locations
authorJouni Malinen <j@w1.fi>
Sun, 20 Oct 2013 18:34:39 +0000 (21:34 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 20 Oct 2013 18:38:02 +0000 (21:38 +0300)
This makes it less likely to forget WPS single-channel scan optimization
in effect after having completed the WPS operation or in case WPS
operating gets cancelled.

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

wpa_supplicant/ctrl_iface.c
wpa_supplicant/wps_supplicant.c

index 2dc64dd..b2d7882 100644 (file)
@@ -5162,6 +5162,7 @@ static void wpa_supplicant_ctrl_iface_flush(struct wpa_supplicant *wpa_s)
 #ifdef CONFIG_WPS
        wpas_wps_cancel(wpa_s);
 #endif /* CONFIG_WPS */
+       wpa_s->after_wps = 0;
 
 #ifdef CONFIG_TDLS_TESTING
        extern unsigned int tdls_testing;
@@ -5595,6 +5596,7 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
                             (wpa_s->wpa_state == WPA_COMPLETED))) {
                                wpa_s->normal_scans = 0;
                                wpa_s->scan_req = MANUAL_SCAN_REQ;
+                               wpa_s->after_wps = 0;
                                wpa_supplicant_req_scan(wpa_s, 0, 0);
                        } else if (wpa_s->sched_scanning) {
                                wpa_printf(MSG_DEBUG, "Stop ongoing "
index a2b941c..0d75464 100644 (file)
@@ -882,6 +882,8 @@ static void wpas_clear_wps(struct wpa_supplicant *wpa_s)
        int id;
        struct wpa_ssid *ssid, *remove_ssid = NULL, *prev_current;
 
+       wpa_s->after_wps = 0;
+
        prev_current = wpa_s->current_ssid;
 
        /* Enable the networks disabled during wpas_wps_reassoc */
@@ -1157,6 +1159,8 @@ int wpas_wps_cancel(struct wpa_supplicant *wpa_s)
                wpas_wps_clear_ap_info(wpa_s);
        }
 
+       wpa_s->after_wps = 0;
+
        return 0;
 }
 
@@ -2465,6 +2469,9 @@ void wpas_wps_update_ap_info(struct wpa_supplicant *wpa_s,
 void wpas_wps_notify_assoc(struct wpa_supplicant *wpa_s, const u8 *bssid)
 {
        struct wps_ap_info *ap;
+
+       wpa_s->after_wps = 0;
+
        if (!wpa_s->wps_ap_iter)
                return;
        ap = wpas_wps_get_ap_info(wpa_s, bssid);