From: Junli Zhao Date: Mon, 8 Jul 2013 09:09:18 +0000 (+0300) Subject: WPS: Disconnect when removing existing WPS network block X-Git-Tag: aosp-kk-from-upstream~135 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c7a67a77195464d667d6f482777a75325b6f3642;p=thirdparty%2Fhostap.git WPS: Disconnect when removing existing WPS network block wpas_clear_wps() was just clearing the current wpa_s->current_ssid pointer when removing a WPS network block which with the device was associated. This could leave the association up even though the network block had already been removed. Prevent this by explicitly disconnecting from the network instead of such clearing current_ssid. Signed-hostap: Jouni Malinen --- diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c index d73e023e6..8e0207cb8 100644 --- a/wpa_supplicant/wps_supplicant.c +++ b/wpa_supplicant/wps_supplicant.c @@ -868,9 +868,8 @@ static void wpas_clear_wps(struct wpa_supplicant *wpa_s) while (ssid) { if (ssid->key_mgmt & WPA_KEY_MGMT_WPS) { if (ssid == wpa_s->current_ssid) { - wpa_s->current_ssid = NULL; - if (ssid != NULL) - wpas_notify_network_changed(wpa_s); + wpa_supplicant_deauthenticate( + wpa_s, WLAN_REASON_DEAUTH_LEAVING); } id = ssid->id; remove_ssid = ssid;