From ab45223b1a3fe51cef453d2a56f8b1f9e5d6adf9 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 10 Mar 2011 18:40:16 +0200 Subject: [PATCH] wpa_supplicant AP: Copy generated UUID for AP configuration If the wpa_supplicant configuration file does not specify an UUID, we need to copy the generated UUID, not the all zeros buffer reserved for the configured UUID. --- wpa_supplicant/ap.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c index 2597816b4..ec2de4ce6 100644 --- a/wpa_supplicant/ap.c +++ b/wpa_supplicant/ap.c @@ -17,6 +17,7 @@ #include "utils/common.h" #include "utils/eloop.h" +#include "utils/uuid.h" #include "common/ieee802_11_defs.h" #include "common/wpa_ctrl.h" #include "ap/hostapd.h" @@ -181,7 +182,10 @@ static int wpa_supplicant_conf_ap(struct wpa_supplicant *wpa_s, bss->model_number = os_strdup(wpa_s->conf->model_number); if (wpa_s->conf->serial_number) bss->serial_number = os_strdup(wpa_s->conf->serial_number); - os_memcpy(bss->uuid, wpa_s->conf->uuid, WPS_UUID_LEN); + if (is_nil_uuid(wpa_s->conf->uuid)) + os_memcpy(bss->uuid, wpa_s->wps->uuid, WPS_UUID_LEN); + else + os_memcpy(bss->uuid, wpa_s->conf->uuid, WPS_UUID_LEN); os_memcpy(bss->os_version, wpa_s->conf->os_version, 4); #endif /* CONFIG_WPS */