]> granicus.if.org Git - pdns/commitdiff
Add an option to allow AXFR of zones with a different serial.
authorKees Monshouwer <mind04@monshouwer.org>
Thu, 16 Mar 2017 20:26:02 +0000 (21:26 +0100)
committermind04 <mind04@monshouwer.org>
Fri, 17 Mar 2017 09:14:43 +0000 (10:14 +0100)
docs/markdown/authoritative/settings.md
pdns/common_startup.cc
pdns/slavecommunicator.cc

index 642782b6987e80d6f48e6d85a3efbdceb0ff7b7e..732f733fd4023bbe09a9fb1783d0127c4e1606d7 100644 (file)
@@ -96,6 +96,13 @@ Static pre-shared authentication key for access to the REST API.
 
 Disallow data modification through the REST API when set.
 
+## `axfr-lower-serial`
+* Boolean
+* Default: no
+* Available since: 4.0.4
+
+Also AXFR a zone from a master with a lower serial.
+
 ## `cache-ttl`
 * Integer
 * Default: 20
index 4dd592b6bceac32d769798d0b6d3d4a8058ff9a2..8eaa5b92c8dbe14061e7067af2507725296d7136 100644 (file)
@@ -193,6 +193,7 @@ void declareArguments()
 
   ::arg().setSwitch("outgoing-axfr-expand-alias", "Expand ALIAS records during outgoing AXFR")="no";
   ::arg().setSwitch("8bit-dns", "Allow 8bit dns queries")="no";
+  ::arg().setSwitch("axfr-lower-serial", "Also AXFR a zone from a master with a lower serial")="no";
 
   ::arg().set("xfr-max-received-mbytes", "Maximum number of megabytes received from an incoming XFR")="100";
 }
index 8bbac78711102ee0193da9613a8cfd606ade1334..9e4a7529e19bf7e2b516a88c912e20dd79b408b0 100644 (file)
@@ -861,7 +861,7 @@ void CommunicatorClass::slaveRefresh(PacketHandler *P)
 
     uint32_t theirserial = ssr.d_freshness[di.id].theirSerial, ourserial = di.serial;
 
-    if(rfc1982LessThan(theirserial, ourserial) && ourserial != 0) {
+    if(rfc1982LessThan(theirserial, ourserial) && ourserial != 0 && !::arg().mustDo("axfr-lower-serial"))  {
       L<<Logger::Error<<"Domain '"<<di.zone<<"' more recent than master, our serial " << ourserial << " > their serial "<< theirserial << endl;
       di.backend->setFresh(di.id);
     }