Changeset 1137

Show
Ignore:
Timestamp:
02/10/08 20:04:36 (8 months ago)
Author:
ahu
Message:

implement pseudo-type 'ADDR' lookup, plus finally tell powerdns that authoritative data also displaces current non-auth data

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/pdns/pdns/qtype.cc

    r1103 r1137  
    7171      insert("MBOXFW",257); 
    7272      insert("CURL",258); 
     73      insert("ADDR",259); 
    7374    } 
    7475} 
  • trunk/pdns/pdns/qtype.hh

    r1122 r1137  
    7474   
    7575  enum typeenum {A=1,NS=2,CNAME=5,SOA=6, MR=9, PTR=12,HINFO=13,MX=15,TXT=16,RP=17,AFSDB=18,KEY=25,AAAA=28,LOC=29,SRV=33,NAPTR=35, OPT=41, 
    76                  SPF=99, AXFR=252, IXFR=251, ANY=255, URL=256, MBOXFW=257, CURL=258} types; 
     76                 SPF=99, AXFR=252, IXFR=251, ANY=255, URL=256, MBOXFW=257, CURL=258, ADDR=259} types; 
    7777private: 
    7878  short int code; 
  • trunk/pdns/pdns/recursor_cache.cc

    r1050 r1137  
    197197  if(d_cachecache.first!=d_cachecache.second) {  
    198198    for(cache_t::const_iterator i=d_cachecache.first; i != d_cachecache.second; ++i)  
    199       if(i->d_qtype == qt.getCode() || qt.getCode()==QType::ANY) { 
     199      if(i->d_qtype == qt.getCode() || qt.getCode()==QType::ANY ||  
     200         (qt.getCode()==QType::ADDR && (i->d_qtype == QType::A || i->d_qtype == QType::AAAA) ) 
     201         ) { 
    200202        typedef cache_t::nth_index<1>::type sequence_t; 
    201203        sequence_t& sidx=d_cache.get<1>(); 
     
    217219            sidx.relocate(sidx.end(), si);  
    218220        } 
    219         if(qt.getCode()!=QType::ANY) // normally if we have a hit, we are done 
     221        if(qt.getCode()!=QType::ANY && qt.getCode()!=QType::ADDR) // normally if we have a hit, we are done 
    220222          break; 
    221223      } 
     
    252254    ce.d_records.clear(); 
    253255 
    254   if(auth && !ce.d_auth) { 
     256  if(auth /* && !ce.d_auth */ ) { 
    255257    ce.d_records.clear(); // clear non-auth data 
    256258    ce.d_auth = true;