Deauthenticate on reconfiguration

This makes sure that the old connection is not maintained if the new
configuration does not allow it anymore. In addition, it is better to
use wpa_supplicant_clear_connection() instead of just clearing
wpa_s->current_ssid here to keep things in sync.
This commit is contained in:
Jouni Malinen 2011-07-16 16:57:11 +03:00
parent 018a309a94
commit 7b7ce8aa13

View file

@ -684,7 +684,6 @@ void wpa_supplicant_clear_status(struct wpa_supplicant *wpa_s)
int wpa_supplicant_reload_configuration(struct wpa_supplicant *wpa_s) int wpa_supplicant_reload_configuration(struct wpa_supplicant *wpa_s)
{ {
struct wpa_config *conf; struct wpa_config *conf;
struct wpa_ssid *old_ssid;
int reconf_ctrl; int reconf_ctrl;
int old_ap_scan; int old_ap_scan;
@ -709,10 +708,10 @@ int wpa_supplicant_reload_configuration(struct wpa_supplicant *wpa_s)
} }
eapol_sm_invalidate_cached_session(wpa_s->eapol); eapol_sm_invalidate_cached_session(wpa_s->eapol);
old_ssid = wpa_s->current_ssid; if (wpa_s->current_ssid) {
wpa_s->current_ssid = NULL; wpa_supplicant_deauthenticate(wpa_s,
if (old_ssid != wpa_s->current_ssid) WLAN_REASON_DEAUTH_LEAVING);
wpas_notify_network_changed(wpa_s); }
/* /*
* TODO: should notify EAPOL SM about changes in opensc_engine_path, * TODO: should notify EAPOL SM about changes in opensc_engine_path,