From: Remi Gacogne Date: Wed, 12 Sep 2018 14:12:46 +0000 (+0200) Subject: rec: Refuse queries for rfc6895 section 3.1 meta types X-Git-Tag: dnsdist-1.3.3~6^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f8a73d6416ee7749ac45e718da5430339a41dde;p=thirdparty%2Fpdns.git rec: Refuse queries for rfc6895 section 3.1 meta types (cherry picked from commit a10ff05255106b8ce8755013fd07077b45ea65e2) --- diff --git a/pdns/syncres.cc b/pdns/syncres.cc index 16c7c73dd1..caaa330784 100644 --- a/pdns/syncres.cc +++ b/pdns/syncres.cc @@ -119,6 +119,8 @@ SyncRes::SyncRes(const struct timeval& now) : d_authzonequeries(0), d_outquerie /** everything begins here - this is the entry point just after receiving a packet */ int SyncRes::beginResolve(const DNSName &qname, const QType &qtype, uint16_t qclass, vector&ret) { + /* rfc6895 section 3.1 + RRSIG and NSEC3 */ + static const std::set metaTypes = { QType::AXFR, QType::IXFR, QType::RRSIG, QType::NSEC3, QType::OPT, QType::TSIG, QType::TKEY, QType::MAILA, QType::MAILB }; vState state = Indeterminate; s_queries++; d_wasVariable=false; @@ -129,8 +131,9 @@ int SyncRes::beginResolve(const DNSName &qname, const QType &qtype, uint16_t qcl return 0; // so do check before updating counters (we do now) } - if( (qtype.getCode() == QType::AXFR) || (qtype.getCode() == QType::IXFR) || (qtype.getCode() == QType::RRSIG) || (qtype.getCode() == QType::NSEC3)) + if (metaTypes.count(qtype.getCode())) { return -1; + } if(qclass==QClass::ANY) qclass=QClass::IN;