summaryrefslogtreecommitdiff
path: root/node/IncomingPacket.cpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2015-10-20 16:31:41 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2015-10-20 16:31:41 -0700
commit59e1444b274465f33ed95aab6a9214d25910f85d (patch)
tree344ae25a56f2e5b087e90d021334d98d6a8aa4a0 /node/IncomingPacket.cpp
parenteb79d4a2f34b34c49cd2d69efac22d9bc8ac27cb (diff)
downloadinfinitytier-59e1444b274465f33ed95aab6a9214d25910f85d.tar.gz
infinitytier-59e1444b274465f33ed95aab6a9214d25910f85d.zip
Finish wiring up Cluster, fix some issues with other recent changes.
Diffstat (limited to 'node/IncomingPacket.cpp')
-rw-r--r--node/IncomingPacket.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/node/IncomingPacket.cpp b/node/IncomingPacket.cpp
index 7a47c0c6..83e50a9e 100644
--- a/node/IncomingPacket.cpp
+++ b/node/IncomingPacket.cpp
@@ -43,6 +43,7 @@
#include "Salsa20.hpp"
#include "SHA512.hpp"
#include "World.hpp"
+#include "Cluster.hpp"
namespace ZeroTier {
@@ -612,8 +613,15 @@ bool IncomingPacket::_doMULTICAST_LIKE(const RuntimeEnvironment *RR,const Shared
const uint64_t now = RR->node->now();
// Iterate through 18-byte network,MAC,ADI tuples
- for(unsigned int ptr=ZT_PACKET_IDX_PAYLOAD;ptr<size();ptr+=18)
- RR->mc->add(now,at<uint64_t>(ptr),MulticastGroup(MAC(field(ptr + 8,6),6),at<uint32_t>(ptr + 14)),peer->address());
+ for(unsigned int ptr=ZT_PACKET_IDX_PAYLOAD;ptr<size();ptr+=18) {
+ const uint32_t nwid(at<uint64_t>(ptr));
+ const MulticastGroup group(MAC(field(ptr + 8,6),6),at<uint32_t>(ptr + 14));
+ RR->mc->add(now,nwid,group,peer->address());
+#ifdef ZT_ENABLE_CLUSTER
+ if (RR->cluster)
+ RR->cluster->replicateMulticastLike(nwid,peer->address(),group);
+#endif
+ }
peer->received(RR,_localAddress,_remoteAddress,hops(),packetId(),Packet::VERB_MULTICAST_LIKE,0,Packet::VERB_NOP);
} catch ( ... ) {
@@ -870,7 +878,7 @@ bool IncomingPacket::_doPUSH_DIRECT_PATHS(const RuntimeEnvironment *RR,const Sha
}
peer->setLastDirectPathPushReceived(now);
- const RemotePath *currentBest = peer->getBestPath();
+ const RemotePath *currentBest = peer->getBestPath(now);
unsigned int count = at<uint16_t>(ZT_PACKET_IDX_PAYLOAD);
unsigned int ptr = ZT_PACKET_IDX_PAYLOAD + 2;