wpa_supplicant AP: Copy generated UUID for AP configuration
authorJouni Malinen <jouni.malinen@atheros.com>
Thu, 10 Mar 2011 16:40:16 +0000 (18:40 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 10 Mar 2011 16:40:16 +0000 (18:40 +0200)
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

index 2597816..ec2de4c 100644 (file)
@@ -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 */