From: Peter van Dijk Date: Thu, 4 Apr 2013 09:38:19 +0000 (+0000) Subject: restore v6 outgoing queries. Sorry :( X-Git-Tag: rec-3.5-rc4~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d96e88da75253d189cc6c738323a77fa09907ca2;p=thirdparty%2Fpdns.git restore v6 outgoing queries. Sorry :( git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@3141 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- diff --git a/pdns/syncres.cc b/pdns/syncres.cc index 69d308846f..3c677e750a 100644 --- a/pdns/syncres.cc +++ b/pdns/syncres.cc @@ -454,7 +454,7 @@ static bool ipv6First(const ComboAddress& a, const ComboAddress& b) /** This function explicitly goes out for A or AAAA addresses */ -vector SyncRes::getAddrs(const string &qname, int type, int depth, set& beenthere) +vector SyncRes::getAddrs(const string &qname, int depth, set& beenthere) { typedef vector res_t; res_t res; @@ -462,10 +462,16 @@ vector SyncRes::getAddrs(const string &qname, int type, int depth, typedef vector 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 nameservers, string auth, pierceDontQuery=true; } else { - remoteIPs=getAddrs(*tns, QType::A, depth+1, beenthere); + remoteIPs=getAddrs(*tns, depth+1, beenthere); pierceDontQuery=false; } diff --git a/pdns/syncres.hh b/pdns/syncres.hh index b678ed481f..5ef7fc030c 100644 --- a/pdns/syncres.hh +++ b/pdns/syncres.hh @@ -382,7 +382,7 @@ private: inline vector shuffleInSpeedOrder(set &nameservers, const string &prefix); bool moreSpecificThan(const string& a, const string &b); - vector getAddrs(const string &qname, int type, int depth, set& beenthere); + vector getAddrs(const string &qname, int depth, set& beenthere); private: ostringstream d_trace;