]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Disassociate when starting WPS search
authorJouni Malinen <j@w1.fi>
Sun, 11 Dec 2011 16:30:47 +0000 (18:30 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 11 Dec 2011 16:30:47 +0000 (18:30 +0200)
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 <j@w1.fi>

wpa_supplicant/wps_supplicant.c

index 89694525b738fd979004346fd85b43c100ecfa84..870aff5b8656bb88aa55937ece0f350325d2220a 100644 (file)
@@ -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) {