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 <j@w1.fi>
This commit is contained in:
Jouni Malinen 2011-12-11 18:30:47 +02:00
parent 5506d18418
commit d9d87c3357

View file

@ -794,6 +794,10 @@ static void wpas_wps_reassoc(struct wpa_supplicant *wpa_s,
{ {
struct wpa_ssid *ssid; 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 */ /* Mark all other networks disabled and trigger reassociation */
ssid = wpa_s->conf->ssid; ssid = wpa_s->conf->ssid;
while (ssid) { while (ssid) {