From: Peter van Dijk Date: Tue, 3 Jun 2014 09:06:00 +0000 (+0000) Subject: remove (non-working) [aaaa-]addition-processing flags from the recursor. Closes ... X-Git-Tag: rec-3.6.0~19^2~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5cdeede95ce8d807b94cbe5596b8c7ba7ca9c222;p=pdns remove (non-working) [aaaa-]addition-processing flags from the recursor. Closes #1448 --- diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index 5fc04a92a..07beb299c 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -1823,9 +1823,6 @@ int serviceMain(int argc, char*argv[]) exit(99); } - SyncRes::s_doAAAAAdditionalProcessing = ::arg().mustDo("aaaa-additional-processing"); - SyncRes::s_doAdditionalProcessing = ::arg().mustDo("additional-processing") | SyncRes::s_doAAAAAdditionalProcessing; - SyncRes::s_noEDNSPing = true; // ::arg().mustDo("disable-edns-ping"); SyncRes::s_noEDNS = ::arg().mustDo("disable-edns"); if(!SyncRes::s_noEDNS) { @@ -2084,8 +2081,6 @@ int main(int argc, char **argv) ::arg().set("soa-minimum-ttl","Don't change")="0"; ::arg().set("soa-serial-offset","Don't change")="0"; ::arg().set("no-shuffle","Don't change")="off"; - ::arg().set("additional-processing","turn on to do additional processing")="off"; - ::arg().set("aaaa-additional-processing","turn on to do AAAA additional processing (slow)")="off"; ::arg().set("local-port","port to listen on")="53"; ::arg().set("local-address","IP addresses to listen on, separated by spaces or commas. Also accepts ports.")="127.0.0.1"; ::arg().set("trace","if we should output heaps of logging. set to 'fail' to only log failing domains")="off"; diff --git a/pdns/syncres.cc b/pdns/syncres.cc index 3f5d01f63..59af83c4f 100644 --- a/pdns/syncres.cc +++ b/pdns/syncres.cc @@ -70,8 +70,6 @@ SyncRes::LogMode SyncRes::s_lm; bool SyncRes::s_noEDNSPing; bool SyncRes::s_noEDNS; -bool SyncRes::s_doAdditionalProcessing; -bool SyncRes::s_doAAAAAdditionalProcessing; SyncRes::SyncRes(const struct timeval& now) : d_outqueries(0), d_tcpoutqueries(0), d_throttledqueries(0), d_timeouts(0), d_unreachables(0), d_now(now), @@ -131,8 +129,6 @@ int SyncRes::beginResolve(const string &qname, const QType &qtype, uint16_t qcla set beenthere; int res=doResolve(qname, qtype, ret, 0, beenthere); - if(!res && s_doAdditionalProcessing) - addCruft(qname, ret); return res; } @@ -1184,57 +1180,6 @@ int SyncRes::doResolveAt(set nameservers, string auth, return -1; } -static bool uniqueComp(const DNSResourceRecord& a, const DNSResourceRecord& b) -{ - return(a.qtype==b.qtype && a.qname==b.qname && a.content==b.content); -} - -void SyncRes::addCruft(const string &qname, vector& ret) -{ - for(vector::const_iterator k=ret.begin();k!=ret.end();++k) // don't add stuff to an NXDOMAIN! - if(k->d_place==DNSResourceRecord::AUTHORITY && k->qtype==QType(QType::SOA)) - return; - - // LOG(qname<<": Adding best authority records from cache"< addit; - - for(vector::const_iterator k=ret.begin();k!=ret.end();++k) - if( (k->d_place==DNSResourceRecord::ANSWER && (k->qtype==QType(QType::MX) || k->qtype==QType(QType::SRV))) || - ((k->d_place==DNSResourceRecord::AUTHORITY || k->d_place==DNSResourceRecord::ANSWER) && k->qtype==QType(QType::NS))) { - LOG(d_prefix<content<<"|"<qtype.getName()<<"' needs IP for additional processing"< beenthere; - vector > fields; - vstringtok(fields, k->content, " "); - string host; - if(k->qtype==QType(QType::MX) && fields.size()==2) - host=string(k->content.c_str() + fields[1].first, fields[1].second - fields[1].first); - else if(k->qtype==QType(QType::NS)) - host=k->content; - else if(k->qtype==QType(QType::SRV) && fields.size()==4) - host=string(k->content.c_str() + fields[3].first, fields[3].second - fields[3].first); - else - continue; - // we used to do additional processing here.. no more - // doResolve(host, QType(QType::A), addit, 1, beenthere); - } - - if(!addit.empty()) { - sort(addit.begin(), addit.end()); - addit.erase(unique(addit.begin(), addit.end(), uniqueComp), addit.end()); - for(vector::iterator k=addit.begin();k!=addit.end();++k) { - if(k->qtype.getCode()==QType::A || k->qtype.getCode()==QType::AAAA) { - k->d_place=DNSResourceRecord::ADDITIONAL; - ret.push_back(*k); - } - } - } - LOG(d_prefix<& ret, int depth) { set bestns; diff --git a/pdns/syncres.hh b/pdns/syncres.hh index 63c31f83d..5182527f0 100644 --- a/pdns/syncres.hh +++ b/pdns/syncres.hh @@ -290,8 +290,6 @@ public: static uint64_t s_nodelegated; static uint64_t s_unreachables; static unsigned int s_minimumTTL; - static bool s_doAAAAAdditionalProcessing; - static bool s_doAdditionalProcessing; static bool s_doIPv6; unsigned int d_outqueries; unsigned int d_tcpoutqueries; @@ -438,7 +436,6 @@ private: bool doCNAMECacheCheck(const string &qname, const QType &qtype, vector&ret, int depth, int &res); bool doCacheCheck(const string &qname, const QType &qtype, vector&ret, int depth, int &res); void getBestNSFromCache(const string &qname, set&bestns, bool* flawedNSSet, int depth, set& beenthere); - void addCruft(const string &qname, vector& ret); string getBestNSNamesFromCache(const string &qname,set& nsset, bool* flawedNSSet, int depth, set&beenthere); void addAuthorityRecords(const string& qname, vector& ret, int depth);