Browse Source

WPS: Clear known_wps_freq in addition to after_wps

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>
Jouni Malinen 11 years ago
parent
commit
4d9fb08d23
3 changed files with 4 additions and 0 deletions
  1. 2 0
      wpa_supplicant/ctrl_iface.c
  2. 1 0
      wpa_supplicant/wpa_supplicant.c
  3. 1 0
      wpa_supplicant/wps_supplicant.c

+ 2 - 0
wpa_supplicant/ctrl_iface.c

@@ -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 "

+ 1 - 0
wpa_supplicant/wpa_supplicant.c

@@ -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 */

+ 1 - 0
wpa_supplicant/wps_supplicant.c

@@ -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;