diff --git a/src/wps/wps.h b/src/wps/wps.h index e206c2d07..9807caa7d 100644 --- a/src/wps/wps.h +++ b/src/wps/wps.h @@ -131,6 +131,8 @@ void wps_registrar_probe_req_rx(struct wps_registrar *reg, const u8 *addr, const struct wpabuf *wps_data); struct wpabuf * wps_enrollee_build_assoc_req_ie(void); -struct wpabuf * wps_enrollee_build_probe_req_ie(int pbc, const u8 *uuid); +struct wpabuf * wps_enrollee_build_probe_req_ie(int pbc, + struct wps_device_data *dev, + const u8 *uuid); #endif /* WPS_H */ diff --git a/src/wps/wps_enrollee.c b/src/wps/wps_enrollee.c index 4a0058aa3..f16a05b29 100644 --- a/src/wps/wps_enrollee.c +++ b/src/wps/wps_enrollee.c @@ -1147,21 +1147,16 @@ struct wpabuf * wps_enrollee_build_assoc_req_ie(void) } -struct wpabuf * wps_enrollee_build_probe_req_ie(int pbc, const u8 *uuid) +struct wpabuf * wps_enrollee_build_probe_req_ie(int pbc, + struct wps_device_data *dev, + const u8 *uuid) { struct wpabuf *ie; u8 *len; u16 methods; - struct wps_device_data dev; wpa_printf(MSG_DEBUG, "WPS: Building WPS IE for Probe Request"); - /* TODO: get device data from caller */ - os_memset(&dev, 0, sizeof(dev)); - dev.categ = WPS_DEV_COMPUTER; - dev.oui = WPS_DEV_OUI_WFA; - dev.sub_categ = WPS_DEV_COMPUTER_PC; - ie = wpabuf_alloc(200); if (ie == NULL) return NULL; @@ -1180,7 +1175,7 @@ struct wpabuf * wps_enrollee_build_probe_req_ie(int pbc, const u8 *uuid) wps_build_req_type(ie, WPS_REQ_ENROLLEE) || wps_build_config_methods(ie, methods) || wps_build_uuid_e(ie, uuid) || - wps_build_primary_dev_type(&dev, ie) || + wps_build_primary_dev_type(dev, ie) || wps_build_rf_bands(NULL, ie) || wps_build_assoc_state(NULL, ie) || wps_build_config_error(NULL, ie) || diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c index 80029206d..fb64ca586 100644 --- a/wpa_supplicant/scan.c +++ b/wpa_supplicant/scan.c @@ -176,6 +176,7 @@ static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx) #ifdef CONFIG_WPS if (wps) { wps_ie = wps_enrollee_build_probe_req_ie(wps == 2, + &wpa_s->wps->dev, wpa_s->conf->uuid); if (wps_ie) { extra_ie = wpabuf_head(wps_ie);