WPS: Update Beacon/ProbeResp IE on wps_version_number changes
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.
This commit is contained in:
parent
2af1c18735
commit
2c8a4eef41
3 changed files with 17 additions and 1 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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 */
|
||||
|
||||
|
|
Loading…
Reference in a new issue