Changeset 662

Show
Ignore:
Timestamp:
04/05/06 17:37:32 (7 years ago)
Author:
ahu
Message:

remove vestiges of 'opaque record' support we now deal with in MOADNSParser, lowercase all NS records we store to prevent duplicates

Location:
trunk/pdns/pdns
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/pdns/pdns/pdns_recursor.cc

    r656 r662  
    222222    nsrr.ttl=time(0)+3600000; 
    223223     
    224     for(char c='A';c<='M';++c) { 
     224    for(char c='a';c<='m';++c) { 
    225225      static char templ[40]; 
    226       strncpy(templ,"A.ROOT-SERVERS.NET", sizeof(templ) - 1); 
     226      strncpy(templ,"a.root-servers.net", sizeof(templ) - 1); 
    227227      *templ=c; 
    228228      arr.qname=nsrr.content=templ; 
    229       arr.content=ips[c-'A']; 
     229      arr.content=ips[c-'a']; 
    230230      set<DNSResourceRecord> aset; 
    231231      aset.insert(arr); 
  • trunk/pdns/pdns/syncres.cc

    r658 r662  
    470470      // reap all answers from this packet that are acceptable 
    471471      for(LWRes::res_t::const_iterator i=result.begin();i!=result.end();++i) { 
    472         if(i->qtype.getCode() < 1024) { 
    473           LOG<<prefix<<qname<<": accept answer '"<<i->qname<<"|"<<i->qtype.getName()<<"|"<<i->content<<"' from '"<<auth<<"' nameservers? "; 
    474         } 
    475         else { 
    476           LOG<<prefix<<qname<<": accept opaque answer '"<<i->qname<<"|"<<QType(i->qtype.getCode()-1024).getName()<<" from '"<<auth<<"' nameservers? "; 
    477         } 
     472        LOG<<prefix<<qname<<": accept answer '"<<i->qname<<"|"<<i->qtype.getName()<<"|"<<i->content<<"' from '"<<auth<<"' nameservers? "; 
    478473         
    479474        if(endsOn(i->qname, auth)) { 
     
    489484            rr.d_place=DNSResourceRecord::ANSWER; 
    490485            rr.ttl+=d_now.tv_sec; 
    491             //    rr.ttl=time(0)+10+10*rr.qtype.getCode(); 
     486            if(rr.qtype.getCode() == QType::NS) // people fiddle with the case 
     487              rr.content=toLower(rr.content); 
    492488            tcache[make_pair(toLower(i->qname),i->qtype)].insert(rr); 
    493489          } 
     
    499495      // supplant 
    500496      for(tcache_t::const_iterator i=tcache.begin();i!=tcache.end();++i) { 
    501         RC.replace(i->first.first,i->first.second,i->second); 
     497        RC.replace(i->first.first, i->first.second, i->second); 
    502498      } 
    503499      set<string> nsset;   
     
    528524        // for ANY answers we *must* have an authoritive answer 
    529525        else if(i->d_place==DNSResourceRecord::ANSWER && !strcasecmp(i->qname.c_str(),qname.c_str()) &&  
    530                 (((i->qtype==qtype) || (i->qtype.getCode()>1024 && i->qtype.getCode()-1024==qtype.getCode()))  
    531                  || ( qtype==QType(QType::ANY) && d_lwr.d_aabit)))  { 
    532           if(i->qtype.getCode() < 1024) { 
    533             LOG<<prefix<<qname<<": answer is in: resolved to '"<< i->content<<"|"<<i->qtype.getName()<<"'"<<endl; 
    534           } 
    535           else { 
    536             LOG<<prefix<<qname<<": answer is in: resolved to opaque record of type '"<<QType(i->qtype.getCode()-1024).getName()<<"'"<<endl; 
    537           } 
     526                ( (i->qtype==qtype) || 
     527                                      ( qtype==QType(QType::ANY) && d_lwr.d_aabit)))  { 
     528           
     529          LOG<<prefix<<qname<<": answer is in: resolved to '"<< i->content<<"|"<<i->qtype.getName()<<"'"<<endl; 
     530 
    538531 
    539532          done=true;