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: rec-4.0.9^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=237e98b9ea430eabbc25da971380119b7f69288e;p=pdns rec: Refuse queries for rfc6895 section 3.1 meta types (cherry picked from commit ab1b5574d15a62e67a133828fc98502de830842c) (cherry picked from commit 834b326fb0ebda4622360a0e0c40888e6dceb946) --- diff --git a/pdns/syncres.cc b/pdns/syncres.cc index 55ce1a711..434b29fd4 100644 --- a/pdns/syncres.cc +++ b/pdns/syncres.cc @@ -124,6 +124,8 @@ SyncRes::SyncRes(const struct timeval& now) : d_outqueries(0), d_tcpoutqueries( /** 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 }; s_queries++; d_wasVariable=false; d_wasOutOfBand=false; @@ -172,6 +174,10 @@ int SyncRes::beginResolve(const DNSName &qname, const QType &qtype, uint16_t qcl return 0; } + if (metaTypes.count(qtype.getCode())) { + return -1; + } + if(qclass==QClass::ANY) qclass=QClass::IN; else if(qclass!=QClass::IN)