Changeset 1029

Show
Ignore:
Timestamp:
04/15/07 00:04:55 (2 years ago)
Author:
ahu
Message:

Thanks to Heinrich Ruthensteiner and Christoph Haas for debugging, the new MOADNS code had trouble encoding . labels in NAPTR records and elsewhere
Plus improve bind query logging somewhat more, plus make pdns_recursor build directly from svn again

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/pdns/pdns/Makefile.am

    r1011 r1029  
    114114dnswriter.cc dnswriter.hh dnsrecords.cc dnsrecords.hh rcpgenerator.cc rcpgenerator.hh \ 
    115115base64.cc base64.hh zoneparser-tng.cc zoneparser-tng.hh rec_channel.cc rec_channel.hh \ 
    116 rec_channel_rec.cc selectmplexer.cc epollmplexer.cc 
     116rec_channel_rec.cc selectmplexer.cc epollmplexer.cc sillyrecords.cc 
    117117 
    118118if NEDMALLOC 
  • trunk/pdns/pdns/backends/bind/bindbackend2.cc

    r1026 r1029  
    818818    return false; 
    819819  } 
    820   if(::arg().mustDo("query-logging")
    821     L<<"Returning: '"<<r.qtype.getName()<<"' of '"<<r.qname<<"', content: '"<<r.content<<"', prio: "<<r.priority<<endl; 
     820  if(d_handle.mustlog
     821    L<<Logger::Warning<<"Returning: '"<<r.qtype.getName()<<"' of '"<<r.qname<<"', content: '"<<r.content<<"', prio: "<<r.priority<<endl; 
    822822  return true; 
    823823} 
     
    857857  r.priority=(d_iter)->priority; 
    858858  d_iter++; 
    859   if(mustlog) 
    860     L<<Logger::Warning<<"Returning: "<< r.qtype.getName()<<" "<<r.content<<endl; 
    861  
    862859 
    863860  return true; 
  • trunk/pdns/pdns/dnspacket.cc

    r986 r1029  
    278278 
    279279  vector<DNSResourceRecord> additional; 
    280   for(pos=rrs.begin();pos<rrs.end();++pos) { 
    281     if(pos->qtype.getCode()==QType::NS) { 
    282       vector<string>pieces; 
    283       stringtok(pieces,pos->content,"@"); 
    284        
    285       if(pieces.size() > 1) { // INSTANT ADDITIONAL PROCESSING! 
    286         rr.qname=pieces[0]; 
    287         rr.qtype=QType::A; 
    288         rr.ttl=pos->ttl; 
    289         rr.content=pieces[1]; 
    290         rr.d_place=DNSResourceRecord::ADDITIONAL; 
    291         additional.push_back(rr); 
    292       } 
    293     } 
    294   } 
     280 
    295281  int ipos=rrs.size(); 
    296282  rrs.resize(rrs.size()+additional.size()); 
     
    319305  if(!rrs.empty()) { 
    320306    try { 
    321       for(pos=rrs.begin();pos<rrs.end();++pos) { 
     307      for(pos=rrs.begin(); pos < rrs.end(); ++pos) { 
    322308        // this needs to deal with the 'prio' mismatch! 
    323309        if(pos->qtype.getCode()==QType::MX || pos->qtype.getCode() == QType::SRV) {   
     
    328314          pos->content="\""+pos->content+"\""; 
    329315        } 
     316        if(pos->content.empty())  // empty contents confuse the MOADNS setup 
     317          pos->content="."; 
    330318        shared_ptr<DNSRecordContent> drc(DNSRecordContent::mastermake(pos->qtype.getCode(), 1, pos->content));  
    331319        drc->toPacket(pw); 
  • trunk/pdns/pdns/dnswriter.cc

    r1026 r1029  
    176176{ 
    177177  parts_t parts; 
     178 
     179  if(label.size()==1 && label[0]=='.') { // otherwise we encode '..' 
     180    d_record.push_back(0); 
     181    return; 
     182  } 
     183 
    178184  bool unescaped=labeltokUnescape(parts, label);  
    179185   
     
    213219      pos+=(i->second - i->first)+1; 
    214220    } 
    215  
    216221  } 
    217222  d_record.push_back(0);