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

Andriy Tkachuk andrit
Thu Apr 22 02:00:45 PDT 2010


Jouni,

Shouldn't we also update WPS IE (when, say, external registrar
configured us from Unconfigured state)?

For example, like this:

diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
index 69e7ad7..a3f9719 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -97,6 +97,7 @@ int hostapd_reload_config(struct hostapd_iface *iface)
 	}
 
 	ieee802_11_set_beacon(hapd);
+	hostapd_update_wps(hapd);
 
 	if (hapd->conf->ssid.ssid_set &&
 	    hostapd_set_ssid(hapd, (u8 *) hapd->conf->ssid.ssid,
diff --git a/src/ap/wps_hostapd.c b/src/ap/wps_hostapd.c
index 9f0aa2a..04d3a85 100644
--- a/src/ap/wps_hostapd.c
+++ b/src/ap/wps_hostapd.c
@@ -686,6 +686,17 @@ void hostapd_deinit_wps(struct hostapd_data *hapd)
 }
 
 
+void hostapd_update_wps(struct hostapd_data *hapd)
+{
+	if (hapd->wps == NULL)
+		return;
+	if (hapd->conf->wps_state)
+		wps_registrar_update_ie(hapd->wps->registrar);
+	else
+		hostapd_deinit_wps(hapd);
+}
+
+
 int hostapd_wps_add_pin(struct hostapd_data *hapd, const char *uuid,
 			const char *pin, int timeout)
 {
diff --git a/src/ap/wps_hostapd.h b/src/ap/wps_hostapd.h
index bf28fb0..0b57403 100644
--- a/src/ap/wps_hostapd.h
+++ b/src/ap/wps_hostapd.h
@@ -20,6 +20,7 @@
 int hostapd_init_wps(struct hostapd_data *hapd,
 		     struct hostapd_bss_config *conf);
 void hostapd_deinit_wps(struct hostapd_data *hapd);
+void hostapd_update_wps(struct hostapd_data *hapd);
 int hostapd_wps_add_pin(struct hostapd_data *hapd, const char *uuid,
 			const char *pin, int timeout);
 int hostapd_wps_button_pushed(struct hostapd_data *hapd);
@@ -40,6 +41,10 @@ static inline void hostapd_deinit_wps(struct hostapd_data *hapd)
 {
 }
 
+static inline void hostapd_update_wps(struct hostapd_data *hapd)
+{
+}
+
 static inline int hostapd_wps_get_mib_sta(struct hostapd_data *hapd,
 					  const u8 *addr,
 					  char *buf, size_t buflen)


Thank you,
    Andriy

On 2010-04-06 20:47, Jouni Malinen wrote:
> On Fri, Mar 19, 2010 at 03:40:34PM +0200, Andriy Tkachuk wrote:
>   
>> 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 Beacon and Probe Response frames do get updated with some drivers
> (e.g., nl80211), but it did not seem to work for the case of WPA/RSN
> parameters being changed or WPA/RSN being disabled when the driver
> wrapper uses set_generic_elem() instead of set_beacon().
>
>   
>> The following patch solved the problem for me:
>>     
>
> Thanks! I applied a bit modified version that will also take care of
> removing WPA/RSN IE when needed.
>
>   



More information about the Hostap mailing list