]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Merge pull request #9196 from pieterlexis/qla-only-v6
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 31 Jul 2020 10:12:49 +0000 (12:12 +0200)
committerGitHub <noreply@github.com>
Fri, 31 Jul 2020 10:12:49 +0000 (12:12 +0200)
rec: Disable outgoing v4 when QLA has no v4 addresses

1  2 
pdns/pdns_recursor.cc
pdns/reczones.cc
pdns/syncres.cc
pdns/syncres.hh

Simple merge
index b0a99480f25acaebe9e63a9f2d08dd2864d480b1,f57be640d2e80c31186e7ab72fc3655b6e5548cc..5bb6312aeae1add88c96a49e08c4b4ccefd15a0a
@@@ -42,10 -42,10 +42,10 @@@ static void insertIntoRootNSZones(cons
    }
  }
  
void primeHints(void)
bool primeHints(void)
  {
    // prime root cache
 -  const vState validationState = Insecure;
 +  const vState validationState = vState::Insecure;
    vector<DNSRecord> nsset;
    t_rootNSZones.clear();
  
diff --cc pdns/syncres.cc
index b84cafde99ae9a2fd992964221f61541950c3d1b,fe40aeea4b6aa097ce80530269c245f18267406b..bd037f056eb71c500a2db5c8a6d861db08162923
@@@ -931,10 -932,10 +932,10 @@@ vector<ComboAddress> SyncRes::getAddrs(
    d_DNSSECValidationRequested = false;
  
    try {
 -    vState newState = Indeterminate;
 +    vState newState = vState::Indeterminate;
      res_t resv4;
      // If IPv4 ever becomes second class, we should revisit this
-     if (doResolve(qname, QType::A, resv4, depth+1, beenthere, newState) == 0) {  // this consults cache, OR goes out
+     if (s_doIPv4 && doResolve(qname, QType::A, resv4, depth+1, beenthere, newState) == 0) {  // this consults cache, OR goes out
        for (auto const &i : resv4) {
          if (i.d_type == QType::A) {
            if (auto rec = getRR<ARecordContent>(i)) {
          }
        }
      }
-     if (s_doIPv6) {
+     if (s_doIPv6) { // s_doIPv6 **IMPLIES** pdns::isQueryLocalAddressFamilyEnabled(AF_INET6) returned true
        if (ret.empty()) {
          // We did not find IPv4 addresses, try to get IPv6 ones
 -        newState = Indeterminate;
 +        newState = vState::Indeterminate;
          res_t resv6;
          if (doResolve(qname, QType::AAAA, resv6, depth+1, beenthere, newState) == 0) {  // this consults cache, OR goes out
            for (const auto &i : resv6) {
diff --cc pdns/syncres.hh
Simple merge