Trigger WPS configuration update on string changes

Previously, only Device Name string was handled, but similar trigger
is needed on Manufacturer, Model Name, Model Number, and Serial Number
changes.
This commit is contained in:
Jouni Malinen 2010-07-29 17:13:11 -07:00 committed by Jouni Malinen
parent 0e14267a31
commit 1c9cb49fe9
3 changed files with 7 additions and 5 deletions

View File

@ -2376,10 +2376,10 @@ static const struct global_parse_data global_fields[] = {
#ifdef CONFIG_WPS
{ FUNC(uuid), CFG_CHANGED_UUID },
{ STR_RANGE(device_name, 0, 32), CFG_CHANGED_DEVICE_NAME },
{ STR_RANGE(manufacturer, 0, 64), 0 },
{ STR_RANGE(model_name, 0, 32), 0 },
{ STR_RANGE(model_number, 0, 32), 0 },
{ STR_RANGE(serial_number, 0, 32), 0 },
{ STR_RANGE(manufacturer, 0, 64), CFG_CHANGED_WPS_STRING },
{ STR_RANGE(model_name, 0, 32), CFG_CHANGED_WPS_STRING },
{ STR_RANGE(model_number, 0, 32), CFG_CHANGED_WPS_STRING },
{ STR_RANGE(serial_number, 0, 32), CFG_CHANGED_WPS_STRING },
{ STR(device_type), CFG_CHANGED_DEVICE_TYPE },
{ FUNC(os_version), CFG_CHANGED_OS_VERSION },
{ STR(config_methods), CFG_CHANGED_CONFIG_METHODS },

View File

@ -36,6 +36,7 @@
#define CFG_CHANGED_COUNTRY BIT(5)
#define CFG_CHANGED_SEC_DEVICE_TYPE BIT(6)
#define CFG_CHANGED_P2P_SSID_POSTFIX BIT(7)
#define CFG_CHANGED_WPS_STRING BIT(8)
/**
* struct wpa_config - wpa_supplicant configuration data

View File

@ -1387,7 +1387,8 @@ void wpas_wps_update_config(struct wpa_supplicant *wpa_s)
os_memcpy(wps->uuid, wpa_s->conf->uuid, WPS_UUID_LEN);
}
if (wpa_s->conf->changed_parameters & CFG_CHANGED_DEVICE_NAME) {
if (wpa_s->conf->changed_parameters &
(CFG_CHANGED_DEVICE_NAME | CFG_CHANGED_WPS_STRING)) {
/* Update pointers to make sure they refer current values */
wps->dev.device_name = wpa_s->conf->device_name;
wps->dev.manufacturer = wpa_s->conf->manufacturer;