From 2810cd7c156393f62c36ae01ba8099766e8dc777 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Sun, 17 May 2015 23:56:47 +0000 Subject: Build fixes for G++, building without SQLite3 present, and warning removal. --- node/InetAddress.cpp | 3 +-- node/Node.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'node') diff --git a/node/InetAddress.cpp b/node/InetAddress.cpp index 54fc763f..940a58b2 100644 --- a/node/InetAddress.cpp +++ b/node/InetAddress.cpp @@ -137,8 +137,7 @@ void InetAddress::set(const void *ipBytes,unsigned int ipLen,unsigned int port) reinterpret_cast(this)->sin_port = Utils::hton((uint16_t)port); } else if (ipLen == 16) { ss_family = AF_INET6; - (reinterpret_cast(reinterpret_cast(this)->sin6_addr.s6_addr))[0] = ((const uint64_t *)ipBytes)[0]; - (reinterpret_cast(reinterpret_cast(this)->sin6_addr.s6_addr))[1] = ((const uint64_t *)ipBytes)[1]; + memcpy(reinterpret_cast(this)->sin6_addr.s6_addr,ipBytes,16); reinterpret_cast(this)->sin6_port = Utils::hton((uint16_t)port); } } diff --git a/node/Node.cpp b/node/Node.cpp index 654465e8..0e3ddd14 100644 --- a/node/Node.cpp +++ b/node/Node.cpp @@ -251,8 +251,10 @@ ZT1_ResultCode Node::processBackgroundTasks(uint64_t now,volatile uint64_t *next if ((now - _lastBeacon) >= ZT_BEACON_INTERVAL) { _lastBeacon = now; char beacon[13]; - *(reinterpret_cast(beacon)) = RR->prng->next32(); - *(reinterpret_cast(beacon + 4)) = RR->prng->next32(); + void *p = beacon; + *(reinterpret_cast(p)) = RR->prng->next32(); + p = beacon + 4; + *(reinterpret_cast(p)) = RR->prng->next32(); RR->identity.address().copyTo(beacon + 8,5); RR->antiRec->logOutgoingZT(beacon,13); putPacket(ZT_DEFAULTS.v4Broadcast,beacon,13,0); -- cgit v1.2.3