]> granicus.if.org Git - pdns/commitdiff
remove vestiges of 'opaque record' support we now deal with in MOADNSParser, lowercas...
authorBert Hubert <bert.hubert@netherlabs.nl>
Wed, 5 Apr 2006 15:37:32 +0000 (15:37 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Wed, 5 Apr 2006 15:37:32 +0000 (15:37 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@662 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/pdns_recursor.cc
pdns/syncres.cc

index 459b757e75e328196e1dbae229fbb8735f3641b1..88f0687b67fdd736b39c66005d4a0df8c8c86a1a 100644 (file)
@@ -221,12 +221,12 @@ void primeHints(void)
     nsrr.qtype=QType::NS;
     nsrr.ttl=time(0)+3600000;
     
-    for(char c='A';c<='M';++c) {
+    for(char c='a';c<='m';++c) {
       static char templ[40];
-      strncpy(templ,"A.ROOT-SERVERS.NET", sizeof(templ) - 1);
+      strncpy(templ,"a.root-servers.net", sizeof(templ) - 1);
       *templ=c;
       arr.qname=nsrr.content=templ;
-      arr.content=ips[c-'A'];
+      arr.content=ips[c-'a'];
       set<DNSResourceRecord> aset;
       aset.insert(arr);
       RC.replace(string(templ), QType(QType::A), aset);
index bbd0d90e862a34656e5ba485ed7e6cabcdc915af..66c86c8298b4e517085d0a26bfcf0181c816a0a5 100644 (file)
@@ -469,12 +469,7 @@ int SyncRes::doResolveAt(set<string> nameservers, string auth, const string &qna
 
       // reap all answers from this packet that are acceptable
       for(LWRes::res_t::const_iterator i=result.begin();i!=result.end();++i) {
-       if(i->qtype.getCode() < 1024) {
-         LOG<<prefix<<qname<<": accept answer '"<<i->qname<<"|"<<i->qtype.getName()<<"|"<<i->content<<"' from '"<<auth<<"' nameservers? ";
-       }
-       else {
-         LOG<<prefix<<qname<<": accept opaque answer '"<<i->qname<<"|"<<QType(i->qtype.getCode()-1024).getName()<<" from '"<<auth<<"' nameservers? ";
-       }
+       LOG<<prefix<<qname<<": accept answer '"<<i->qname<<"|"<<i->qtype.getName()<<"|"<<i->content<<"' from '"<<auth<<"' nameservers? ";
        
        if(endsOn(i->qname, auth)) {
          if(d_lwr.d_aabit && d_lwr.d_rcode==RCode::NoError && i->d_place==DNSResourceRecord::ANSWER && ::arg().contains("delegation-only",auth)) {
@@ -488,7 +483,8 @@ int SyncRes::doResolveAt(set<string> nameservers, string auth, const string &qna
            DNSResourceRecord rr=*i;
            rr.d_place=DNSResourceRecord::ANSWER;
            rr.ttl+=d_now.tv_sec;
-           //    rr.ttl=time(0)+10+10*rr.qtype.getCode();
+           if(rr.qtype.getCode() == QType::NS) // people fiddle with the case
+             rr.content=toLower(rr.content);
            tcache[make_pair(toLower(i->qname),i->qtype)].insert(rr);
          }
        }         
@@ -498,7 +494,7 @@ int SyncRes::doResolveAt(set<string> nameservers, string auth, const string &qna
     
       // supplant
       for(tcache_t::const_iterator i=tcache.begin();i!=tcache.end();++i) {
-       RC.replace(i->first.first,i->first.second,i->second);
+       RC.replace(i->first.first, i->first.second, i->second);
       }
       set<string> nsset;  
       LOG<<prefix<<qname<<": determining status after receiving this packet"<<endl;
@@ -527,14 +523,11 @@ int SyncRes::doResolveAt(set<string> nameservers, string auth, const string &qna
        }
        // for ANY answers we *must* have an authoritive answer
        else if(i->d_place==DNSResourceRecord::ANSWER && !strcasecmp(i->qname.c_str(),qname.c_str()) && 
-               (((i->qtype==qtype) || (i->qtype.getCode()>1024 && i->qtype.getCode()-1024==qtype.getCode())) 
-                || ( qtype==QType(QType::ANY) && d_lwr.d_aabit)))  {
-         if(i->qtype.getCode() < 1024) {
-           LOG<<prefix<<qname<<": answer is in: resolved to '"<< i->content<<"|"<<i->qtype.getName()<<"'"<<endl;
-         }
-         else {
-           LOG<<prefix<<qname<<": answer is in: resolved to opaque record of type '"<<QType(i->qtype.getCode()-1024).getName()<<"'"<<endl;
-         }
+               ( (i->qtype==qtype) ||
+                                     ( qtype==QType(QType::ANY) && d_lwr.d_aabit)))  {
+         
+         LOG<<prefix<<qname<<": answer is in: resolved to '"<< i->content<<"|"<<i->qtype.getName()<<"'"<<endl;
+
 
          done=true;
          ret.push_back(*i);