P2P: Add Device Name into WPS IE in Probe Request frames

This commit is contained in:
Jouni Malinen 2010-07-18 14:30:24 -07:00 committed by Jouni Malinen
parent 91a9464528
commit 63675def6e
4 changed files with 18 additions and 0 deletions

View file

@ -488,6 +488,11 @@ struct wpabuf * wps_build_probe_req_ie(int pbc, struct wps_device_data *dev,
return NULL;
}
if (dev->p2p && wps_build_dev_name(dev, ie)) {
wpabuf_free(ie);
return NULL;
}
return wps_ie_encapsulate(ie);
}

View file

@ -75,6 +75,7 @@ struct wps_credential {
* @pri_dev_type: Primary Device Type
* @os_version: OS Version
* @rf_bands: RF bands (WPS_RF_24GHZ, WPS_RF_50GHZ flags)
* @p2p: Whether the device is a P2P device
*/
struct wps_device_data {
u8 mac_addr[ETH_ALEN];
@ -86,6 +87,8 @@ struct wps_device_data {
u8 pri_dev_type[WPS_DEV_TYPE_LEN];
u32 os_version;
u8 rf_bands;
int p2p;
};
struct oob_conf_data {

View file

@ -26,6 +26,7 @@ int wps_build_os_version(struct wps_device_data *dev, struct wpabuf *msg);
int wps_build_rf_bands(struct wps_device_data *dev, struct wpabuf *msg);
int wps_build_primary_dev_type(struct wps_device_data *dev,
struct wpabuf *msg);
int wps_build_dev_name(struct wps_device_data *dev, struct wpabuf *msg);
int wps_process_device_attrs(struct wps_device_data *dev,
struct wps_parse_attr *attr);
int wps_process_os_version(struct wps_device_data *dev, const u8 *ver);

View file

@ -1056,6 +1056,15 @@ static int wps_set_ie(struct wps_registrar *reg)
return -1;
}
#ifdef CONFIG_P2P
if (wps_build_dev_name(&reg->wps->dev, beacon) ||
wps_build_primary_dev_type(&reg->wps->dev, beacon)) {
wpabuf_free(beacon);
wpabuf_free(probe);
return -1;
}
#endif /* CONFIG_P2P */
beacon = wps_ie_encapsulate(beacon);
probe = wps_ie_encapsulate(probe);