[patch] hostapd does not update WPA IE in driver on reconfiguration

Andriy Tkachuk andriy.v.tkachuk at globallogic.com
Fri Mar 19 09:40:34 EDT 2010


Hi Jouni and folks.

While trying to configure AP with external registrar I noticed that
hostapd does not update WPA IE in driver on reconfiguration. Indeed, if
changing security options in hostapd.conf manually and then send HUP
signal to hostapd - it won't  update WPA IE in driver, as result, the
change won't affect security settings in beacons (and probe responses as
well). I detected the problem on 0.6.10 version, but it looks like
latest 0.7 version also suffers from this.

The following patch solved the problem for me:

diff --git a/hostapd/hostapd.c b/hostapd/hostapd.c
index 7ed1720..38fa987 100644
--- a/hostapd/hostapd.c
+++ b/hostapd/hostapd.c
@@ -369,8 +373,16 @@ 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) {
+		const u8 *wpa_ie;
+		size_t wpa_ie_len;
 		hostapd_wpa_auth_conf(&newconf->bss[0], &wpa_auth_conf);
 		wpa_reconfig(hapd->wpa_auth, &wpa_auth_conf);
+		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.");
+			return -1;
+		}
 	} else if (hapd->wpa_auth) {
 		wpa_deinit(hapd->wpa_auth);
 		hapd->wpa_auth = NULL;


Thank you,
    Andriy


More information about the HostAP mailing list