]> granicus.if.org Git - pdns/commitdiff
remove (non-working) [aaaa-]addition-processing flags from the recursor. Closes ...
authorPeter van Dijk <peter.van.dijk@netherlabs.nl>
Tue, 3 Jun 2014 09:06:00 +0000 (09:06 +0000)
committerPeter van Dijk <peter.van.dijk@netherlabs.nl>
Tue, 3 Jun 2014 09:08:45 +0000 (09:08 +0000)
pdns/pdns_recursor.cc
pdns/syncres.cc
pdns/syncres.hh

index 5fc04a92a28b5d9e4a64d31cf78e5bdbba87b911..07beb299c245a38b07651d54d52facab9362e378 100644 (file)
@@ -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";
index 3f5d01f633042f54336882545517cb5bb6244d91..59af83c4f36aa4b54825cf28bd6eae7ef4efd3db 100644 (file)
@@ -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<GetBestNSAnswer> 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<string, CIStringCompare> 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<DNSResourceRecord>& ret)
-{
-  for(vector<DNSResourceRecord>::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"<<endl);
-  // addAuthorityRecords(qname,ret,0);
-  // LOG(qname<<": Done adding best authority records."<<endl);
-
-  LOG(d_prefix<<qname<<": Starting additional processing"<<endl);
-  vector<DNSResourceRecord> addit;
-
-  for(vector<DNSResourceRecord>::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<<qname<<": record '"<<k->content<<"|"<<k->qtype.getName()<<"' needs IP for additional processing"<<endl);
-      set<GetBestNSAnswer> beenthere;
-      vector<pair<string::size_type, string::size_type> > 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<DNSResourceRecord>::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<<qname<<": Done with additional processing"<<endl);
-}
-
 void SyncRes::addAuthorityRecords(const string& qname, vector<DNSResourceRecord>& ret, int depth)
 {
   set<DNSResourceRecord> bestns;
index 63c31f83dbb7f053980b499ef6a3c339a7cacc62..5182527f058d466d6f1d033efc1ab5f63419c834 100644 (file)
@@ -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<DNSResourceRecord>&ret, int depth, int &res);
   bool doCacheCheck(const string &qname, const QType &qtype, vector<DNSResourceRecord>&ret, int depth, int &res);
   void getBestNSFromCache(const string &qname, set<DNSResourceRecord>&bestns, bool* flawedNSSet, int depth, set<GetBestNSAnswer>& beenthere);
-  void addCruft(const string &qname, vector<DNSResourceRecord>& ret);
   string getBestNSNamesFromCache(const string &qname,set<string, CIStringCompare>& nsset, bool* flawedNSSet, int depth, set<GetBestNSAnswer>&beenthere);
   void addAuthorityRecords(const string& qname, vector<DNSResourceRecord>& ret, int depth);