Changeset 1130
- Timestamp:
- 02/04/08 23:32:49 (8 months ago)
- Files:
-
- trunk/pdns/pdns/lwres.cc (modified) (2 diffs)
- trunk/pdns/pdns/lwres.hh (modified) (1 diff)
- trunk/pdns/pdns/pdns_recursor.cc (modified) (2 diffs)
- trunk/pdns/pdns/syncres.cc (modified) (3 diffs)
- trunk/pdns/pdns/syncres.hh (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/pdns/pdns/lwres.cc
r1117 r1130 41 41 //! returns -2 for OS limits error, -1 for permanent error that has to do with remote, 0 for timeout, 1 for success 42 42 /** Never throws! */ 43 int asyncresolve(const ComboAddress& ip, const string& domain, int type, bool doTCP, struct timeval* now, LWResult *lwr)43 int asyncresolve(const ComboAddress& ip, const string& domain, int type, bool doTCP, bool doEDNS0, struct timeval* now, LWResult *lwr) 44 44 { 45 45 int len; … … 51 51 pw.getHeader()->rd=0; 52 52 pw.getHeader()->id=Utility::random(); 53 54 if(doEDNS0 && !doTCP) { 55 pw.addOpt(1200, 0, 0); // 1200 bytes answer size 56 pw.commit(); 57 } 53 58 lwr->d_rcode=0; 54 59 trunk/pdns/pdns/lwres.hh
r1117 r1130 64 64 }; 65 65 66 int asyncresolve(const ComboAddress& ip, const string& domain, int type, bool doTCP, struct timeval* now, LWResult* res);66 int asyncresolve(const ComboAddress& ip, const string& domain, int type, bool doTCP, bool doEDNS0, struct timeval* now, LWResult* res); 67 67 68 68 #endif // PDNS_LWRES_HH trunk/pdns/pdns/pdns_recursor.cc
r1118 r1130 34 34 #include <signal.h> 35 35 #include <stdlib.h> 36 #include "htimer.hh"37 36 38 37 #include "mtasker.hh" … … 1128 1127 if(now.tv_sec - last_rootupdate > 7200) { 1129 1128 SyncRes sr(now); 1129 sr.setDoEDNS0(true); 1130 1130 vector<DNSResourceRecord> ret; 1131 1131 trunk/pdns/pdns/syncres.cc
r1126 r1130 213 213 ComboAddress remoteIP(server, 53); 214 214 215 res=asyncresolve(remoteIP, qname, qtype.getCode(), false, &d_now, &lwr);215 res=asyncresolve(remoteIP, qname, qtype.getCode(), false, false, &d_now, &lwr); 216 216 // filter out the good stuff from lwr.result() 217 217 … … 681 681 } 682 682 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! 684 684 if(resolveret != 1) { 685 685 if(resolveret==0) { … … 747 747 // reap all answers from this packet that are acceptable 748 748 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 } 749 753 LOG<<prefix<<qname<<": accept answer '"<<i->qname<<"|"<<i->qtype.getName()<<"|"<<i->content<<"' from '"<<auth<<"' nameservers? "; 750 754 if(i->qtype.getCode()==QType::ANY) { trunk/pdns/pdns/syncres.hh
r1117 r1130 213 213 explicit SyncRes(const struct timeval& now) : d_outqueries(0), d_tcpoutqueries(0), d_throttledqueries(0), d_timeouts(0), d_unreachables(0), 214 214 d_now(now), 215 d_cacheonly(false), d_nocache(false) { }215 d_cacheonly(false), d_nocache(false), d_doEDNS0(false) { } 216 216 int beginResolve(const string &qname, const QType &qtype, uint16_t qclass, vector<DNSResourceRecord>&ret); 217 217 void setId(int id) … … 232 232 d_nocache=state; 233 233 } 234 235 void setDoEDNS0(bool state=true) 236 { 237 d_doEDNS0=state; 238 } 239 234 240 static unsigned int s_queries; 235 241 static unsigned int s_outgoingtimeouts; … … 373 379 bool d_cacheonly; 374 380 bool d_nocache; 381 bool d_doEDNS0; 375 382 376 383 struct GetBestNSAnswer