aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/wps_supplicant.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2011-03-10 16:36:07 (GMT)
committerJouni Malinen <j@w1.fi>2011-03-10 16:36:07 (GMT)
commitca29141c83fccbc1685003ea05bed5127ff1f4c1 (patch)
treea4e79a16db24e6c6ad02b66ea819a5dbc87e7dff /wpa_supplicant/wps_supplicant.c
parentb0dc4155c3d4b279b4679e8e82e41588dc5341b2 (diff)
downloadhostap-ca29141c83fccbc1685003ea05bed5127ff1f4c1.zip
hostap-ca29141c83fccbc1685003ea05bed5127ff1f4c1.tar.gz
hostap-ca29141c83fccbc1685003ea05bed5127ff1f4c1.tar.bz2
WPS: Copy UUID from the first interface
Instead of generating a different UUID for each interface, use the same UUID that was either configured of generated for the first interface. This avoids potential issues with PBC session overlap detection should multiple interfaces end up running a PBC scan at the same time which may happen at least in some P2P use cases.
Diffstat (limited to 'wpa_supplicant/wps_supplicant.c')
-rw-r--r--wpa_supplicant/wps_supplicant.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c
index 94a60c7..1ed403c 100644
--- a/wpa_supplicant/wps_supplicant.c
+++ b/wpa_supplicant/wps_supplicant.c
@@ -1101,12 +1101,23 @@ int wpas_wps_init(struct wpa_supplicant *wpa_s)
wps->dev.os_version = WPA_GET_BE32(wpa_s->conf->os_version);
wps->dev.rf_bands = WPS_RF_24GHZ | WPS_RF_50GHZ; /* TODO: config */
os_memcpy(wps->dev.mac_addr, wpa_s->own_addr, ETH_ALEN);
+ wpa_printf(MSG_DEBUG, "WPS: Set UUID for interface %s", wpa_s->ifname);
if (is_nil_uuid(wpa_s->conf->uuid)) {
- uuid_gen_mac_addr(wpa_s->own_addr, wps->uuid);
- wpa_hexdump(MSG_DEBUG, "WPS: UUID based on MAC address",
- wps->uuid, WPS_UUID_LEN);
- } else
+ if (wpa_s->global->ifaces && wpa_s->global->ifaces != wpa_s) {
+ os_memcpy(wps->uuid, wpa_s->global->ifaces->wps->uuid,
+ WPS_UUID_LEN);
+ wpa_hexdump(MSG_DEBUG, "WPS: UUID from the first "
+ "interface", wps->uuid, WPS_UUID_LEN);
+ } else {
+ uuid_gen_mac_addr(wpa_s->own_addr, wps->uuid);
+ wpa_hexdump(MSG_DEBUG, "WPS: UUID based on MAC "
+ "address", wps->uuid, WPS_UUID_LEN);
+ }
+ } else {
os_memcpy(wps->uuid, wpa_s->conf->uuid, WPS_UUID_LEN);
+ wpa_hexdump(MSG_DEBUG, "WPS: UUID based on configuration",
+ wps->uuid, WPS_UUID_LEN);
+ }
wps->auth_types = WPS_AUTH_WPA2PSK | WPS_AUTH_WPAPSK;
wps->encr_types = WPS_ENCR_AES | WPS_ENCR_TKIP;