]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Update WPS IE on hostapd reconfiguration
authorAndriy Tkachuk <andrit@ukr.net>
Sun, 2 May 2010 08:21:19 +0000 (11:21 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 2 May 2010 08:21:19 +0000 (11:21 +0300)
This is needed to handle cases where WPS state may have changed and
hostapd is reloading its configuration.

src/ap/hostapd.c
src/ap/wps_hostapd.c
src/ap/wps_hostapd.h

index 69e7ad756948b94f710110c75db0b6bd77ef6ab3..a3f97196d644a44ca213b7fd40b823b2351839f0 100644 (file)
@@ -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,
index 9f0aa2ac4067e0499143f2ad651d6c4636b79322..04d3a85b3b0f18620d790aa652d75792819b2049 100644 (file)
@@ -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)
 {
index bf28fb0f3b68340578847447670dd1a618847a4c..0b574032e5e78969353fdc0e8fda59f3169ddf09 100644 (file)
@@ -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)