From: Otto Moerbeek Date: Mon, 15 Apr 2019 14:11:06 +0000 (+0200) Subject: Avoid shadowing of var names and use modern C++ X-Git-Tag: dnsdist-1.4.0-beta1~25^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b84ce13e61e6baa2383180033622dbcd4c19251d;p=pdns Avoid shadowing of var names and use modern C++ --- diff --git a/pdns/syncres.cc b/pdns/syncres.cc index 4aeef4d02..3c6f3f1de 100644 --- a/pdns/syncres.cc +++ b/pdns/syncres.cc @@ -691,10 +691,10 @@ vector SyncRes::getAddrs(const DNSName &qname, unsigned int depth, d_cacheonly = cacheOnly; vState newState = Indeterminate; - res_t res; + res_t resv4; // If IPv4 ever becomes second class, we should revisit this - if (doResolve(qname, QType::A, res, depth+1, beenthere, newState) == 0) { // this consults cache, OR goes out - for (res_t::const_iterator i = res.begin(); i != res.end(); ++i) { + if (doResolve(qname, QType::A, resv4, depth+1, beenthere, newState) == 0) { // this consults cache, OR goes out + for (auto i = resv4.cbegin(); i != resv4.end(); ++i) { if (i->d_type == QType::A) { if (auto rec = getRR(*i)) { ret.push_back(rec->getCA(53)); @@ -705,10 +705,10 @@ vector SyncRes::getAddrs(const DNSName &qname, unsigned int depth, if (s_doIPv6) { if (ret.empty()) { // We did not find IPv4 addresses, try to get IPv6 ones - vState newState = Indeterminate; - res_t res; - if (doResolve(qname, QType::AAAA, res,depth+1, beenthere, newState) == 0) { // this consults cache, OR goes out - for (res_t::const_iterator i = res.begin(); i != res.end(); ++i) { + newState = Indeterminate; + res_t resv6; + if (doResolve(qname, QType::AAAA, resv6, depth+1, beenthere, newState) == 0) { // this consults cache, OR goes out + for (auto i = resv6.cbegin(); i != resv6.end(); ++i) { if (i->d_type == QType::AAAA) { if (auto rec = getRR(*i)) ret.push_back(rec->getCA(53));