generate hw_addr from apname

This commit is contained in:
James Laird
2013-04-01 23:06:55 +11:00
parent c627bae022
commit 8a3f2fad16
+9
View File
@@ -27,6 +27,7 @@
#include <signal.h>
#include <unistd.h>
#include <memory.h>
#include <openssl/md5.h>
#include "common.h"
#include "rtsp.h"
#include "mdns.h"
@@ -121,6 +122,14 @@ int main(int argc, char **argv) {
}
config.output->init(argc-audio_arg, argv+audio_arg);
uint8_t ap_md5[16];
MD5_CTX ctx;
MD5_Init(&ctx);
MD5_Update(&ctx, config.apname, strlen(config.apname));
MD5_Final(ap_md5, &ctx);
memcpy(config.hw_addr, ap_md5, sizeof(config.hw_addr));
// mask off all signals before creating threads.
// this way we control which thread gets which signals.
// for now, we don't care which thread gets the following.