From 4f53d09c7e446e20e0a8da3bdb6bdc5b138cf55c Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Mon, 16 Sep 2013 14:47:48 -0400 Subject: Build fix for 32-bit Linux and tweaks to address derivation algorithm. --- node/Multicaster.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'node/Multicaster.hpp') diff --git a/node/Multicaster.hpp b/node/Multicaster.hpp index 8ff8e65e..3a4f355d 100644 --- a/node/Multicaster.hpp +++ b/node/Multicaster.hpp @@ -99,10 +99,11 @@ public: throw(std::runtime_error) { char tmp[65536]; - *((uint64_t *)tmp) = Utils::hton(nwid); + void *tmp2 = (void *)tmp; + *((uint64_t *)tmp2) = Utils::hton((uint64_t)nwid); memcpy(tmp + 8,from.data,6); memcpy(tmp + 14,to.mac().data,6); - *((uint32_t *)(tmp + 20)) = Utils::hton(to.adi()); + *((uint32_t *)(tmp + 20)) = Utils::hton((uint32_t)to.adi()); *((uint16_t *)(tmp + 24)) = Utils::hton((uint16_t)etherType); memcpy(tmp + 26,data,std::min((unsigned int)(sizeof(tmp) - 26),len)); // min() is a sanity check here, no packet is that big return id.sign(tmp,len + 26); @@ -125,7 +126,8 @@ public: static bool verifyMulticastPacket(const Identity &id,uint64_t nwid,const MAC &from,const MulticastGroup &to,unsigned int etherType,const void *data,unsigned int len,const void *signature,unsigned int siglen) { char tmp[65536]; - *((uint64_t *)tmp) = Utils::hton(nwid); + void *tmp2 = (void *)tmp; + *((uint64_t *)tmp2) = Utils::hton(nwid); memcpy(tmp + 8,from.data,6); memcpy(tmp + 14,to.mac().data,6); *((uint32_t *)(tmp + 20)) = Utils::hton(to.adi()); -- cgit v1.2.3