summaryrefslogtreecommitdiff
path: root/node/Switch.cpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2017-02-01 14:18:56 -0800
committerAdam Ierymenko <adam.ierymenko@gmail.com>2017-02-01 14:18:56 -0800
commit29ec7bf3a2e70fcf3b38a39cf00e8dd7ac9e0818 (patch)
tree8ce3ba3a77f14bf4e818fa205606b6b5527e86ad /node/Switch.cpp
parentfc3f4fb988c77d35792e593c17715a223a126d60 (diff)
downloadinfinitytier-29ec7bf3a2e70fcf3b38a39cf00e8dd7ac9e0818.tar.gz
infinitytier-29ec7bf3a2e70fcf3b38a39cf00e8dd7ac9e0818.zip
Add more specific check in source==self case instead of dumping it.
Diffstat (limited to 'node/Switch.cpp')
-rw-r--r--node/Switch.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/node/Switch.cpp b/node/Switch.cpp
index fdf889ea..cddf0f66 100644
--- a/node/Switch.cpp
+++ b/node/Switch.cpp
@@ -199,6 +199,14 @@ void Switch::onRemotePacket(const InetAddress &localAddr,const InetAddress &from
//TRACE("<< %.16llx %s -> %s (size: %u)",(unsigned long long)packet->packetId(),source.toString().c_str(),destination.toString().c_str(),packet->size());
+#ifdef ZT_ENABLE_CLUSTER
+ if ( (source == RR->identity.address()) && ((!RR->cluster)||(!RR->cluster->isClusterPeerFrontplane(fromAddr))) )
+ return;
+#else
+ if (source == RR->identity.address())
+ return;
+#endif
+
if (destination != RR->identity.address()) {
if ( (!RR->topology->amRoot()) && (!path->trustEstablished(now)) )
return;
@@ -206,7 +214,12 @@ void Switch::onRemotePacket(const InetAddress &localAddr,const InetAddress &from
Packet packet(data,len);
if (packet.hops() < ZT_RELAY_MAX_HOPS) {
+#ifdef ZT_ENABLE_CLUSTER
+ if (source != RR->identity.address())
+ packet.incrementHops();
+#else
packet.incrementHops();
+#endif
SharedPtr<Peer> relayTo = RR->topology->getPeer(destination);
if ((relayTo)&&((relayTo->sendDirect(packet.data(),packet.size(),now,false)))) {