summaryrefslogtreecommitdiff
path: root/node
diff options
context:
space:
mode:
Diffstat (limited to 'node')
-rw-r--r--node/InetAddress.cpp2
-rw-r--r--node/Peer.cpp11
2 files changed, 6 insertions, 7 deletions
diff --git a/node/InetAddress.cpp b/node/InetAddress.cpp
index 91bfbed6..1942c4cd 100644
--- a/node/InetAddress.cpp
+++ b/node/InetAddress.cpp
@@ -74,7 +74,7 @@ InetAddress::IpScope InetAddress::ipScope() const
if ((ip & 0xfff00000) == 0xac100000) return IP_SCOPE_PRIVATE; // 172.16.0.0/12
break;
case 0xc0:
- if ((ip & 0xffff0000) == 0xc9a80000) return IP_SCOPE_PRIVATE; // 192.168.0.0/16
+ if ((ip & 0xffff0000) == 0xc0a80000) return IP_SCOPE_PRIVATE; // 192.168.0.0/16
break;
case 0xff: return IP_SCOPE_NONE; // 255.0.0.0/8 (broadcast, or unused/unusable)
default:
diff --git a/node/Peer.cpp b/node/Peer.cpp
index 804e6e39..ab3d61a6 100644
--- a/node/Peer.cpp
+++ b/node/Peer.cpp
@@ -226,15 +226,13 @@ void Peer::doPingAndKeepalive(const RuntimeEnvironment *RR,uint64_t now)
void Peer::pushDirectPaths(const RuntimeEnvironment *RR,RemotePath *path,uint64_t now,bool force)
{
- if ((((now - _lastDirectPathPush) >= ZT_DIRECT_PATH_PUSH_INTERVAL)||(force))) {
+ if ((true)||(((now - _lastDirectPathPush) >= ZT_DIRECT_PATH_PUSH_INTERVAL)||(force))) {
_lastDirectPathPush = now;
std::vector<Path> dps(RR->node->directPaths());
- /* Also push paths reported to us by non-root-server peers. This assists
- * with NAT traversal behind NATs that engage in strange or randomized
- * port assignment behavior. */
- std::vector<Address> rootAddresses(RR->topology->rootAddresses());
+ // Push peer-reported surface -- tried this and it didn't help much with difficult NATs so commenting out.
+ /*
std::vector< std::pair<Address,InetAddress> > surface(RR->sa->getReportedSurface());
for(std::vector< std::pair<Address,InetAddress> >::const_iterator s(surface.begin());s!=surface.end();++s) {
bool alreadyHave = false;
@@ -244,9 +242,10 @@ void Peer::pushDirectPaths(const RuntimeEnvironment *RR,RemotePath *path,uint64_
break;
}
}
- if ((!alreadyHave)&&(std::find(rootAddresses.begin(),rootAddresses.end(),s->first) == rootAddresses.end()))
+ if (!alreadyHave)
dps.push_back(Path(s->second,0,Path::TRUST_NORMAL));
}
+ */
#ifdef ZT_TRACE
{