[patch] hostapd does not update WPA IE in driver on reconfiguration
Andriy Tkachuk
andriy.v.tkachuk
Fri Mar 19 06:50:20 PDT 2010
BTW, maybe we should not return here if setting of IE failed. So the
final patch may look like this:
@@ -369,8 +373,14 @@ 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 update WPA IE in "
+ "the kernel driver.");
} else if (hapd->wpa_auth) {
wpa_deinit(hapd->wpa_auth);
hapd->wpa_auth = NULL;
Regards,
Andriy
On 2010-03-19 15:40, Andriy Tkachuk wrote:
> 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
> _______________________________________________
> HostAP mailing list
> HostAP at lists.shmoo.com
> http://lists.shmoo.com/mailman/listinfo/hostap
>
More information about the Hostap
mailing list