From 0f3148bda2420c99529194ccc1422d22bd6575bd Mon Sep 17 00:00:00 2001
From: Adam Ierymenko <adam.ierymenko@gmail.com>
Date: Fri, 10 Mar 2017 20:08:07 -0800
Subject: Roots need to respond to lots of WHOISes

---
 node/Constants.hpp      | 2 +-
 node/IncomingPacket.cpp | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

(limited to 'node')

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;
 		}
-- 
cgit v1.2.3