Changeset 1130

Show
Ignore:
Timestamp:
02/04/08 23:32:49 (8 months ago)
Author:
ahu
Message:

reprime root hints using EDNS0, thanks to dns-operations AT mail.oarc.isc.org

Files:

Legend:

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

    r1117 r1130  
    4141//! returns -2 for OS limits error, -1 for permanent error that has to do with remote, 0 for timeout, 1 for success 
    4242/** Never throws! */ 
    43 int asyncresolve(const ComboAddress& ip, const string& domain, int type, bool doTCP, struct timeval* now, LWResult *lwr) 
     43int asyncresolve(const ComboAddress& ip, const string& domain, int type, bool doTCP, bool doEDNS0, struct timeval* now, LWResult *lwr) 
    4444{ 
    4545  int len;  
     
    5151  pw.getHeader()->rd=0; 
    5252  pw.getHeader()->id=Utility::random(); 
     53 
     54  if(doEDNS0 && !doTCP) { 
     55    pw.addOpt(1200, 0, 0); // 1200 bytes answer size 
     56    pw.commit(); 
     57  } 
    5358  lwr->d_rcode=0; 
    5459 
  • trunk/pdns/pdns/lwres.hh

    r1117 r1130  
    6464}; 
    6565 
    66 int asyncresolve(const ComboAddress& ip, const string& domain, int type, bool doTCP, struct timeval* now, LWResult* res); 
     66int asyncresolve(const ComboAddress& ip, const string& domain, int type, bool doTCP, bool doEDNS0, struct timeval* now, LWResult* res); 
    6767 
    6868#endif // PDNS_LWRES_HH 
  • trunk/pdns/pdns/pdns_recursor.cc

    r1118 r1130  
    3434#include <signal.h> 
    3535#include <stdlib.h> 
    36 #include "htimer.hh" 
    3736 
    3837#include "mtasker.hh" 
     
    11281127  if(now.tv_sec - last_rootupdate > 7200) { 
    11291128    SyncRes sr(now); 
     1129    sr.setDoEDNS0(true); 
    11301130    vector<DNSResourceRecord> ret; 
    11311131 
  • trunk/pdns/pdns/syncres.cc

    r1126 r1130  
    213213          ComboAddress remoteIP(server, 53); 
    214214 
    215           res=asyncresolve(remoteIP, qname, qtype.getCode(), false, &d_now, &lwr);     
     215          res=asyncresolve(remoteIP, qname, qtype.getCode(), false, false, &d_now, &lwr);     
    216216          // filter out the good stuff from lwr.result() 
    217217 
     
    681681            } 
    682682             
    683             resolveret=asyncresolve(*remoteIP, qname, qtype.getCode(), doTCP, &d_now, &lwr);    // <- we go out on the wire! 
     683            resolveret=asyncresolve(*remoteIP, qname, qtype.getCode(), doTCP, d_doEDNS0, &d_now, &lwr);    // <- we go out on the wire! 
    684684            if(resolveret != 1) { 
    685685              if(resolveret==0) { 
     
    747747      // reap all answers from this packet that are acceptable 
    748748      for(LWResult::res_t::const_iterator i=lwr.d_result.begin();i != lwr.d_result.end();++i) { 
     749        if(i->qtype.getCode() == QType::OPT) { 
     750          LOG<<prefix<<qname<<": skipping OPT answer '"<<i->qname<<"' from '"<<auth<<"' nameservers" <<endl; 
     751          continue; 
     752        } 
    749753        LOG<<prefix<<qname<<": accept answer '"<<i->qname<<"|"<<i->qtype.getName()<<"|"<<i->content<<"' from '"<<auth<<"' nameservers? "; 
    750754        if(i->qtype.getCode()==QType::ANY) { 
  • trunk/pdns/pdns/syncres.hh

    r1117 r1130  
    213213  explicit SyncRes(const struct timeval& now) :  d_outqueries(0), d_tcpoutqueries(0), d_throttledqueries(0), d_timeouts(0), d_unreachables(0), 
    214214                                                 d_now(now), 
    215                                                  d_cacheonly(false), d_nocache(false) { } 
     215                                                 d_cacheonly(false), d_nocache(false), d_doEDNS0(false) { } 
    216216  int beginResolve(const string &qname, const QType &qtype, uint16_t qclass, vector<DNSResourceRecord>&ret); 
    217217  void setId(int id) 
     
    232232    d_nocache=state; 
    233233  } 
     234 
     235  void setDoEDNS0(bool state=true) 
     236  { 
     237    d_doEDNS0=state; 
     238  } 
     239 
    234240  static unsigned int s_queries; 
    235241  static unsigned int s_outgoingtimeouts; 
     
    373379  bool d_cacheonly; 
    374380  bool d_nocache; 
     381  bool d_doEDNS0; 
    375382 
    376383  struct GetBestNSAnswer