From: Jouni Malinen Date: Sat, 27 Sep 2014 19:41:28 +0000 (+0300) Subject: WPS: Fix WPS-in-search check when STA_AUTOCONNECT is disabled X-Git-Tag: hostap_2_3~69 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e252b0db3cfbc345384feaeac7b7a934610448a;p=thirdparty%2Fhostap.git WPS: Fix WPS-in-search check when STA_AUTOCONNECT is disabled If "STA_AUTOCONNECT 0" has been used to disable automatic connection on disconnection event and the driver indicates multiple disconnection events for the disconnection from the current AP when WPS is started, it could have been possible to hit a case where wpa_s->disconnected was set to 1 during WPS processing and the following scan result processing would stop the operation. wpa_s->key_mgmt == WPA_KEY_MGMT_WPS check was trying to avoid to skip autoconnect when WPS was in use, but that does not seem to work anymore. Fix this by checking through wpas_wps_searching() as well to avoid setting wpa_s->disconnect = 1 when there is an ongoing WPS operation. Signed-off-by: Jouni Malinen --- diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index 1a0bc41f1..cf870c51d 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -2159,10 +2159,12 @@ static void wpa_supplicant_event_disassoc_finish(struct wpa_supplicant *wpa_s, } if (!wpa_s->disconnected && (!wpa_s->auto_reconnect_disabled || - wpa_s->key_mgmt == WPA_KEY_MGMT_WPS)) { + wpa_s->key_mgmt == WPA_KEY_MGMT_WPS || + wpas_wps_searching(wpa_s))) { wpa_dbg(wpa_s, MSG_DEBUG, "Auto connect enabled: try to " - "reconnect (wps=%d wpa_state=%d)", + "reconnect (wps=%d/%d wpa_state=%d)", wpa_s->key_mgmt == WPA_KEY_MGMT_WPS, + wpas_wps_searching(wpa_s), wpa_s->wpa_state); if (wpa_s->wpa_state == WPA_COMPLETED && wpa_s->current_ssid &&