summaryrefslogtreecommitdiff
path: root/node
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2017-03-10 20:08:07 -0800
committerAdam Ierymenko <adam.ierymenko@gmail.com>2017-03-10 20:08:07 -0800
commit0f3148bda2420c99529194ccc1422d22bd6575bd (patch)
tree9754fcb9df5db2149fab1e7dcfa23b3c6d79d0d7 /node
parente3b1fc2ac060408b1c0ec61aa3215bc03ef18848 (diff)
downloadinfinitytier-0f3148bda2420c99529194ccc1422d22bd6575bd.tar.gz
infinitytier-0f3148bda2420c99529194ccc1422d22bd6575bd.zip
Roots need to respond to lots of WHOISes
Diffstat (limited to 'node')
-rw-r--r--node/Constants.hpp2
-rw-r--r--node/IncomingPacket.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/node/Constants.hpp b/node/Constants.hpp
index c2961f12..410a245b 100644
--- a/node/Constants.hpp
+++ b/node/Constants.hpp
@@ -393,7 +393,7 @@
/**
* WHOIS rate limit (we allow these to be pretty fast)
*/
-#define ZT_PEER_WHOIS_RATE_LIMIT 50
+#define ZT_PEER_WHOIS_RATE_LIMIT 100
/**
* General rate limit for other kinds of rate-limited packets (HELLO, credential request, etc.) both inbound and outbound
diff --git a/node/IncomingPacket.cpp b/node/IncomingPacket.cpp
index f3ec7505..800985dc 100644
--- a/node/IncomingPacket.cpp
+++ b/node/IncomingPacket.cpp
@@ -552,7 +552,7 @@ bool IncomingPacket::_doOK(const RuntimeEnvironment *RR,const SharedPtr<Peer> &p
bool IncomingPacket::_doWHOIS(const RuntimeEnvironment *RR,const SharedPtr<Peer> &peer)
{
try {
- if (!peer->rateGateInboundWhoisRequest(RR->node->now())) {
+ if ((!RR->topology->amRoot())&&(!peer->rateGateInboundWhoisRequest(RR->node->now()))) {
TRACE("dropped WHOIS from %s(%s): rate limit circuit breaker tripped",source().toString().c_str(),_path->address().toString().c_str());
return true;
}