Browse Source

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.
Jouni Malinen 14 years ago
parent
commit
ab45223b1a
1 changed files with 5 additions and 1 deletions
  1. 5 1
      wpa_supplicant/ap.c

+ 5 - 1
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 */