]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WPS: Update Beacon/ProbeResp IE on wps_version_number changes
authorJouni Malinen <jouni.malinen@atheros.com>
Tue, 19 Oct 2010 16:57:01 +0000 (19:57 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 19 Oct 2010 16:57:01 +0000 (19:57 +0300)
This test command is supposed to change the WPS version number in all
places immediately, so make sure that the IEs used in management
frames get updated immediately.

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

index af83b8d8a5f83d7914b874476b347aa08a045a82..2cdcdc13a3025330b6764a455515405c94726341 100644 (file)
@@ -661,7 +661,7 @@ static int hostapd_ctrl_iface_get_config(struct hostapd_data *hapd,
 }
 
 
-static int hostapd_ctrl_iface_set(struct hostapd_data *wpa_s, char *cmd)
+static int hostapd_ctrl_iface_set(struct hostapd_data *hapd, char *cmd)
 {
        char *value;
        int ret = 0;
@@ -687,6 +687,7 @@ static int hostapd_ctrl_iface_set(struct hostapd_data *wpa_s, char *cmd)
                                   "version %u.%u",
                                   (wps_version_number & 0xf0) >> 4,
                                   wps_version_number & 0x0f);
+                       hostapd_wps_update_ie(hapd);
                }
        } else if (os_strcasecmp(cmd, "wps_testing_dummy_cred") == 0) {
                wps_testing_dummy_cred = atoi(value);
index b2f6a78c05b8078c917e87da81d438a870efed38..7ff9aa0c0c62fca6570ff74134b9291ccbf7ff06 100644 (file)
@@ -1272,3 +1272,17 @@ int hostapd_wps_ap_pin_set(struct hostapd_data *hapd, const char *pin,
        data.timeout = timeout;
        return hostapd_wps_for_each(hapd, wps_ap_pin_set, &data);
 }
+
+
+static int wps_update_ie(struct hostapd_data *hapd, void *ctx)
+{
+       if (hapd->wps)
+               wps_registrar_update_ie(hapd->wps->registrar);
+       return 0;
+}
+
+
+void hostapd_wps_update_ie(struct hostapd_data *hapd)
+{
+       return hostapd_wps_for_each(hapd, wps_update_ie, NULL);
+}
index b9d525aa3151f272b8cb6d68b7f1668f245ef4b0..fac736bf4cd4168ae6f7f892bf14f146288572a0 100644 (file)
@@ -33,6 +33,7 @@ const char * hostapd_wps_ap_pin_random(struct hostapd_data *hapd, int timeout);
 const char * hostapd_wps_ap_pin_get(struct hostapd_data *hapd);
 int hostapd_wps_ap_pin_set(struct hostapd_data *hapd, const char *pin,
                           int timeout);
+void hostapd_wps_update_ie(struct hostapd_data *hapd);
 
 #else /* CONFIG_WPS */