From 99f4ae67b7a241902c01178478b7b213849f53f7 Mon Sep 17 00:00:00 2001 From: Andriy Tkachuk Date: Tue, 6 Apr 2010 20:44:26 +0300 Subject: [PATCH] Fix WPA/RSN IE update on reconfig with set_generic_elem() IF WPA/RSN parameters were changed or WPA/RSN was disabled, the WPA/RSN IE in Beacon/Probe Response frames was only update with set_beacon(). We need to do this with set_generic_elem(), too, to work with all driver wrappers. --- src/ap/hostapd.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index 2c0c87d4f..bf6057006 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -80,13 +80,20 @@ int hostapd_reload_config(struct hostapd_iface *iface) if (hapd->conf->wpa && hapd->wpa_auth == NULL) hostapd_setup_wpa(hapd); - else if (hapd->conf->wpa) + else if (hapd->conf->wpa) { + const u8 *wpa_ie; + size_t wpa_ie_len; hostapd_reconfig_wpa(hapd); - else if (hapd->wpa_auth) { + wpa_ie = wpa_auth_get_wpa_ie(hapd->wpa_auth, &wpa_ie_len); + if (hostapd_set_generic_elem(hapd, wpa_ie, wpa_ie_len)) + wpa_printf(MSG_ERROR, "Failed to configure WPA IE for " + "the kernel driver."); + } else if (hapd->wpa_auth) { wpa_deinit(hapd->wpa_auth); hapd->wpa_auth = NULL; hostapd_set_privacy(hapd, 0); hostapd_setup_encryption(hapd->conf->iface, hapd); + hostapd_set_generic_elem(hapd, (u8 *) "", 0); } ieee802_11_set_beacon(hapd);