summaryrefslogtreecommitdiff
path: root/node/Cluster.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/Cluster.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/Cluster.cpp')
-rw-r--r--node/Cluster.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/node/Cluster.cpp b/node/Cluster.cpp
index 3e33d802..7cf6b08b 100644
--- a/node/Cluster.cpp
+++ b/node/Cluster.cpp
@@ -862,6 +862,19 @@ bool Cluster::findBetterEndpoint(InetAddress &redirectTo,const Address &peerAddr
}
}
+bool Cluster::isClusterPeerFrontplane(const InetAddress &ip) const
+{
+ Mutex::Lock _l(_memberIds_m);
+ for(std::vector<uint16_t>::const_iterator mid(_memberIds.begin());mid!=_memberIds.end();++mid) {
+ Mutex::Lock _l2(_members[*mid].lock);
+ for(std::vector<InetAddress>::const_iterator i2(_members[*mid].zeroTierPhysicalEndpoints.begin());i2!=_members[*mid].zeroTierPhysicalEndpoints.end();++i2) {
+ if (ip == *i2)
+ return true;
+ }
+ }
+ return false;
+}
+
void Cluster::status(ZT_ClusterStatus &status) const
{
const uint64_t now = RR->node->now();