From 0f76617d1013f69179257d8cbe62c58ffdde400c Mon Sep 17 00:00:00 2001 From: Kees Monshouwer Date: Thu, 16 Mar 2017 21:26:02 +0100 Subject: [PATCH] Add an option to allow AXFR of zones with a different serial. --- docs/markdown/authoritative/settings.md | 7 +++++++ pdns/common_startup.cc | 1 + pdns/slavecommunicator.cc | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/markdown/authoritative/settings.md b/docs/markdown/authoritative/settings.md index 642782b698..732f733fd4 100644 --- a/docs/markdown/authoritative/settings.md +++ b/docs/markdown/authoritative/settings.md @@ -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 diff --git a/pdns/common_startup.cc b/pdns/common_startup.cc index 4dd592b6bc..8eaa5b92c8 100644 --- a/pdns/common_startup.cc +++ b/pdns/common_startup.cc @@ -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"; } diff --git a/pdns/slavecommunicator.cc b/pdns/slavecommunicator.cc index 8bbac78711..9e4a7529e1 100644 --- a/pdns/slavecommunicator.cc +++ b/pdns/slavecommunicator.cc @@ -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< their serial "<< theirserial << endl; di.backend->setFresh(di.id); } -- 2.47.2