From 8a3f2fad160afbeec5efcab1b08d5d6c2a20d4cc Mon Sep 17 00:00:00 2001 From: James Laird Date: Mon, 1 Apr 2013 23:06:55 +1100 Subject: [PATCH] generate hw_addr from apname --- shairport.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/shairport.c b/shairport.c index ca462acc..80410862 100644 --- a/shairport.c +++ b/shairport.c @@ -27,6 +27,7 @@ #include #include #include +#include #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.