summaryrefslogtreecommitdiff
path: root/node/Multicaster.hpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2013-09-16 14:47:48 -0400
committerAdam Ierymenko <adam.ierymenko@gmail.com>2013-09-16 14:47:48 -0400
commit4f53d09c7e446e20e0a8da3bdb6bdc5b138cf55c (patch)
tree8aead771147f1279d77dd0a6f2e108b20bc70e92 /node/Multicaster.hpp
parente376c6f6a989d99d873918b349405302b62403a5 (diff)
downloadinfinitytier-4f53d09c7e446e20e0a8da3bdb6bdc5b138cf55c.tar.gz
infinitytier-4f53d09c7e446e20e0a8da3bdb6bdc5b138cf55c.zip
Build fix for 32-bit Linux and tweaks to address derivation algorithm.
Diffstat (limited to 'node/Multicaster.hpp')
-rw-r--r--node/Multicaster.hpp8
1 files changed, 5 insertions, 3 deletions
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());