summaryrefslogtreecommitdiff
path: root/node/SelfAwareness.cpp
diff options
context:
space:
mode:
authorGrant Limberg <glimberg@gmail.com>2015-07-28 19:18:33 -0700
committerGrant Limberg <glimberg@gmail.com>2015-07-28 19:18:33 -0700
commit508d31513a0848236258542930cf577d95afda99 (patch)
tree453b31d874e6ec0dee3105191142efc8a326a30d /node/SelfAwareness.cpp
parentbc0954381ccdca065987512a45d5dd6ace6cca9d (diff)
parent7578b5629849f6c286c353dce713b0816b1cc4a9 (diff)
downloadinfinitytier-508d31513a0848236258542930cf577d95afda99.tar.gz
infinitytier-508d31513a0848236258542930cf577d95afda99.zip
Merge branch 'adamierymenko-dev' into android-jni
Diffstat (limited to 'node/SelfAwareness.cpp')
-rw-r--r--node/SelfAwareness.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/node/SelfAwareness.cpp b/node/SelfAwareness.cpp
index 00015788..716cf7f3 100644
--- a/node/SelfAwareness.cpp
+++ b/node/SelfAwareness.cpp
@@ -147,4 +147,19 @@ void SelfAwareness::clean(uint64_t now)
}
}
+bool SelfAwareness::areGlobalIPv4PortsRandomized() const
+{
+ int port = 0;
+ Mutex::Lock _l(_phy_m);
+ for(std::map< PhySurfaceKey,PhySurfaceEntry >::const_iterator p(_phy.begin());p!=_phy.end();++p) {
+ if ((p->first.scope == InetAddress::IP_SCOPE_GLOBAL)&&(p->second.mySurface.ss_family == AF_INET)) {
+ const int tmp = (int)p->second.mySurface.port();
+ if ((port)&&(tmp != port))
+ return true;
+ else port = tmp;
+ }
+ }
+ return false;
+}
+
} // namespace ZeroTier