]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
restore v6 outgoing queries. Sorry :(
authorPeter van Dijk <peter.van.dijk@netherlabs.nl>
Thu, 4 Apr 2013 09:38:19 +0000 (09:38 +0000)
committerPeter van Dijk <peter.van.dijk@netherlabs.nl>
Thu, 4 Apr 2013 09:38:19 +0000 (09:38 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@3141 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/syncres.cc
pdns/syncres.hh

index 69d308846f099dae10fde56b9ab69dfc884fe88a..3c677e750ac5cef0523767ad8cf2bac613622a8a 100644 (file)
@@ -454,7 +454,7 @@ static bool ipv6First(const ComboAddress& a, const ComboAddress& b)
 
 /** This function explicitly goes out for A or AAAA addresses
 */
-vector<ComboAddress> SyncRes::getAddrs(const string &qname, int type, int depth, set<GetBestNSAnswer>& beenthere)
+vector<ComboAddress> SyncRes::getAddrs(const string &qname, int depth, set<GetBestNSAnswer>& beenthere)
 {
   typedef vector<DNSResourceRecord> res_t;
   res_t res;
@@ -462,10 +462,16 @@ vector<ComboAddress> SyncRes::getAddrs(const string &qname, int type, int depth,
   typedef vector<ComboAddress> ret_t;
   ret_t ret;
 
-  if(!doResolve(qname, QType(type), res,depth+1,beenthere) && !res.empty()) {  // this consults cache, OR goes out
-    for(res_t::const_iterator i=res.begin(); i!= res.end(); ++i) {
-      if(i->qtype.getCode()==QType::A || i->qtype.getCode()==QType::AAAA) {
-       ret.push_back(ComboAddress(i->content, 53));
+  QType type;
+  for(int j=0; j<1+s_doIPv6; j++)
+  {
+    type = j ? QType::AAAA : QType::A;
+
+    if(!doResolve(qname, type, res,depth+1,beenthere) && !res.empty()) {  // this consults cache, OR goes out
+      for(res_t::const_iterator i=res.begin(); i!= res.end(); ++i) {
+        if(i->qtype.getCode()==QType::A || i->qtype.getCode()==QType::AAAA) {
+       ret.push_back(ComboAddress(i->content, 53));
+        }
       }
     }
   }
@@ -854,7 +860,7 @@ int SyncRes::doResolveAt(set<string, CIStringCompare> nameservers, string auth,
           pierceDontQuery=true;
         }
         else {
-          remoteIPs=getAddrs(*tns, QType::A, depth+1, beenthere);
+          remoteIPs=getAddrs(*tns, depth+1, beenthere);
           pierceDontQuery=false;
         }
 
index b678ed481fc27843f4bc377abedc37d661e69d54..5ef7fc030c94c70791cbe2c5efd6e9aee950ea2d 100644 (file)
@@ -382,7 +382,7 @@ private:
 
   inline vector<string> shuffleInSpeedOrder(set<string, CIStringCompare> &nameservers, const string &prefix);
   bool moreSpecificThan(const string& a, const string &b);
-  vector<ComboAddress> getAddrs(const string &qname, int type, int depth, set<GetBestNSAnswer>& beenthere);
+  vector<ComboAddress> getAddrs(const string &qname, int depth, set<GetBestNSAnswer>& beenthere);
 
 private:
   ostringstream d_trace;