diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-10-16 10:28:09 -0700 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-10-16 10:28:09 -0700 |
| commit | 5ce3aac929ef217f3e813b5bc948dd28d021835f (patch) | |
| tree | aa579f458354bdd376d43c62e291ba697bfe8444 /node/Peer.cpp | |
| parent | 2229e91b57676c1218b550749a2108372e0f37ad (diff) | |
| download | infinitytier-5ce3aac929ef217f3e813b5bc948dd28d021835f.tar.gz infinitytier-5ce3aac929ef217f3e813b5bc948dd28d021835f.zip | |
Add rate limit on receive of DIRECT_PATH_PUSH to prevent DOS exploitation.
Diffstat (limited to 'node/Peer.cpp')
| -rw-r--r-- | node/Peer.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/node/Peer.cpp b/node/Peer.cpp index becc77f9..8c5c5783 100644 --- a/node/Peer.cpp +++ b/node/Peer.cpp @@ -52,7 +52,8 @@ Peer::Peer(const Identity &myIdentity,const Identity &peerIdentity) _lastMulticastFrame(0), _lastAnnouncedTo(0), _lastPathConfirmationSent(0), - _lastDirectPathPush(0), + _lastDirectPathPushSent(0), + _lastDirectPathPushReceived(0), _lastPathSort(0), _vMajor(0), _vMinor(0), @@ -210,8 +211,8 @@ void Peer::pushDirectPaths(const RuntimeEnvironment *RR,RemotePath *path,uint64_ { Mutex::Lock _l(_lock); - if (((now - _lastDirectPathPush) >= ZT_DIRECT_PATH_PUSH_INTERVAL)||(force)) { - _lastDirectPathPush = now; + if (((now - _lastDirectPathPushSent) >= ZT_DIRECT_PATH_PUSH_INTERVAL)||(force)) { + _lastDirectPathPushSent = now; std::vector<Path> dps(RR->node->directPaths()); if (dps.empty()) |
