aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/wps_supplicant.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2011-12-11 16:30:47 (GMT)
committerJouni Malinen <j@w1.fi>2011-12-11 16:30:47 (GMT)
commitd9d87c3357bb7042fd4dc6858403fe5464698d01 (patch)
treec406405b340a66982bb3637e9ccc4b3462b89f83 /wpa_supplicant/wps_supplicant.c
parent5506d18418f4632c2d1349f392104c0c39fc2610 (diff)
downloadhostap-d9d87c3357bb7042fd4dc6858403fe5464698d01.zip
hostap-d9d87c3357bb7042fd4dc6858403fe5464698d01.tar.gz
hostap-d9d87c3357bb7042fd4dc6858403fe5464698d01.tar.bz2
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>
Diffstat (limited to 'wpa_supplicant/wps_supplicant.c')
-rw-r--r--wpa_supplicant/wps_supplicant.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c
index 8969452..870aff5 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) {