From d9d87c3357bb7042fd4dc6858403fe5464698d01 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 11 Dec 2011 18:30:47 +0200 Subject: [PATCH] Disassociate when starting WPS search Previously, the WPS scans could have been done in associated state if we happened to be associated when the request to use WPS was received. This can slow down scanning and end up in unexpected state if no WPS association is tried. Avoid these issues by disconnecting when WPS search is started. Signed-hostap: Jouni Malinen --- wpa_supplicant/wps_supplicant.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c index 89694525b..870aff5b8 100644 --- a/wpa_supplicant/wps_supplicant.c +++ b/wpa_supplicant/wps_supplicant.c @@ -794,6 +794,10 @@ static void wpas_wps_reassoc(struct wpa_supplicant *wpa_s, { struct wpa_ssid *ssid; + if (wpa_s->current_ssid) + wpa_supplicant_deauthenticate( + wpa_s, WLAN_REASON_DEAUTH_LEAVING); + /* Mark all other networks disabled and trigger reassociation */ ssid = wpa_s->conf->ssid; while (ssid) {