From 0f3148bda2420c99529194ccc1422d22bd6575bd Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Fri, 10 Mar 2017 20:08:07 -0800 Subject: [PATCH] Roots need to respond to lots of WHOISes --- node/Constants.hpp | 2 +- node/IncomingPacket.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/node/Constants.hpp b/node/Constants.hpp index c2961f122..410a245ba 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 f3ec75057..800985dc4 100644 --- a/node/IncomingPacket.cpp +++ b/node/IncomingPacket.cpp @@ -552,7 +552,7 @@ bool IncomingPacket::_doOK(const RuntimeEnvironment *RR,const SharedPtr &p bool IncomingPacket::_doWHOIS(const RuntimeEnvironment *RR,const SharedPtr &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; }