]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Merge pull request #6872 from pieterlexis/ixfrdist-limit-size
authoraerique <aerique@xs4all.nl>
Tue, 26 Feb 2019 15:43:10 +0000 (16:43 +0100)
committerGitHub <noreply@github.com>
Tue, 26 Feb 2019 15:43:10 +0000 (16:43 +0100)
ixfrdist: Add option to limit AXFR record count

1  2 
docs/manpages/ixfrdist.yml.5.rst
pdns/ixfrdist.cc
pdns/ixfrdist.example.yml

Simple merge
index 1ba8ffed0c0213ca501fbb887e5c0e65b2777cc7,48f26f07008be6df1a6511d9ab78ee796105f053..f49e0fae56228e7b77dd6c547589e048680eca81
@@@ -267,11 -232,9 +267,11 @@@ static void updateCurrentZoneInfo(cons
  {
    std::lock_guard<std::mutex> guard(g_soas_mutex);
    g_soas[domain] = newInfo;
 +  g_stats.setSOASerial(domain, newInfo->soa->d_st.serial);
 +  // FIXME: also report zone size?
  }
  
- void updateThread(const string& workdir, const uint16_t& keep, const uint16_t& axfrTimeout, const uint16_t& soaRetry) {
+ void updateThread(const string& workdir, const uint16_t& keep, const uint16_t& axfrTimeout, const uint16_t& soaRetry, const uint32_t axfrMaxRecords) {
    setThreadName("ixfrdist/update");
    std::map<DNSName, time_t> lastCheck;
  
              nrecords++;
              if (dr.d_type == QType::SOA) {
                soa = getRR<SOARecordContent>(dr);
 +              soaTTL = dr.d_ttl;
              }
            }
+           if (axfrMaxRecords != 0 && nrecords > axfrMaxRecords) {
+             throw PDNSException("Received more than " + std::to_string(axfrMaxRecords) + " records in AXFR, aborted");
+           }
            axfr_now = time(nullptr);
            if (axfr_now - t_start > axfrTimeout) {
 +            g_stats.incrementAXFRFailures(domain);
              throw PDNSException("Total AXFR time exceeded!");
            }
          }
Simple merge