]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
backport superslave setting to 4.1.x, but default to yes 7922/head
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Wed, 12 Jun 2019 18:10:37 +0000 (20:10 +0200)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Wed, 12 Jun 2019 18:10:55 +0000 (20:10 +0200)
docs/modes-of-operation.rst
docs/settings.rst
pdns/common_startup.cc
pdns/packethandler.cc
regression-tests.nobackend/supermaster-signed/command
regression-tests.nobackend/supermaster-unsigned/command

index ab6a3007b0f59bd23222acc59430b47b2ca5ae79..e068c906a5c4b9fd322b13d57c0cce4c501e3096 100644 (file)
@@ -190,6 +190,7 @@ itself as a slave for that zone.
 Before a supermaster notification succeeds, the following conditions
 must be met:
 
+ - :ref:`setting-superslave` support must be enabled
  - The supermaster must carry a SOA record for the notified domain
  - The supermaster IP must be present in the 'supermaster' table
  - The set of NS records for the domain, as retrieved by the slave from the supermaster, must include the name that goes with the IP address in the supermaster table
index a429bc9392a4788f79405098544f96cf8c25d97e..6eb093c4467655945314afc8e3200d053b92b8e1 100644 (file)
@@ -1327,6 +1327,20 @@ and :doc:`Virtual Hosting <guides/virtual-instances>` how this can differ.
 
 .. _setting-tcp-control-address:
 
+.. _setting-superslave:
+
+``superslave``
+---------------
+
+-  Boolean
+-  Default: yes
+
+.. versionadded:: 4.1.9
+  In versions before 4.1.9, this setting did not exist, it was not possible to disable
+  supermaster support.
+
+Turn on supermaster support. See :ref:`supermaster-operation`.
+
 ``tcp-control-address``
 -----------------------
 
index 463a3a33ed3a69e0c3f531dc2decf8817f151506..6480a78c95e8ad364c34d7138c580f250005b933 100644 (file)
@@ -124,6 +124,7 @@ void declareArguments()
   
   ::arg().setSwitch("slave","Act as a slave")="no";
   ::arg().setSwitch("master","Act as a master")="no";
+  ::arg().setSwitch("superslave", "Act as a superslave")="yes";
   ::arg().setSwitch("disable-axfr-rectify","Disable the rectify step during an outgoing AXFR. Only required for regression testing.")="no";
   ::arg().setSwitch("guardian","Run within a guardian process")="no";
   ::arg().setSwitch("prevent-self-notification","Don't send notifications to what we think is ourself")="yes";
index ce8ea39f5395f0e112aab9d7cfdd580817ce49a8..5b8acd733f28806d5d5909267811d654c5930d91 100644 (file)
@@ -821,8 +821,12 @@ int PacketHandler::processNotify(DNSPacket *p)
   DomainInfo di;
   di.serial = 0;
   if(!B.getDomainInfo(p->qdomain, di) || !(db=di.backend)) {
-    L<<Logger::Error<<"Received NOTIFY for "<<p->qdomain<<" from "<<p->getRemote()<<" for which we are not authoritative"<<endl;
-    return trySuperMaster(p, p->getTSIGKeyname());
+    if(::arg().mustDo("superslave")) {
+      L<<Logger::Warning<<"Received NOTIFY for "<<p->qdomain<<" from "<<p->getRemote()<<" for which we are not authoritative"<<endl;
+      return trySuperMaster(p, p->getTSIGKeyname());
+    }
+    L<<Logger::Notice<<"Received NOTIFY for "<<p->qdomain<<" from "<<p->getRemote()<<" for which we are not authoritative (Refused)"<<endl;
+    return RCode::Refused;
   }
 
   meta.clear();
index 5c88e5a2df54f773384a8a2200fafe5ed7c93fc3..ffb0da45c548e69b59b68852c46079a357307143 100755 (executable)
@@ -94,7 +94,7 @@ start_slave()
 
         $RUNWRAPPER $PDNS2 --daemon=no --local-port=$slaveport --config-dir=. --module-dir=../regression-tests/modules \
                 --config-name=gsqlite3-slave --socket-dir=./ --no-shuffle --local-address=127.0.0.2 --local-ipv6='' \
-                --slave --retrieval-threads=4 --slave=yes --query-local-address=127.0.0.2 \
+                --slave --retrieval-threads=4 --slave=yes --superslave=yes --query-local-address=127.0.0.2 \
                 --slave-cycle-interval=300 --allow-unsigned-notify=no --allow-unsigned-supermaster=no &
 }
 
index 1e9f0c7faa87a44b27734a5911d1e0a7e8d3ef9e..6311fd2d01951f324dac2ce2ef2b03e290bbd0aa 100755 (executable)
@@ -85,7 +85,7 @@ start_slave()
 
         $RUNWRAPPER $PDNS2 --daemon=no --local-port=$slaveport --config-dir=. --module-dir=../regression-tests/modules \
                 --config-name=gsqlite3-slave --socket-dir=./ --no-shuffle --local-address=127.0.0.2 --local-ipv6= \
-                --slave --retrieval-threads=4 --slave=yes --query-local-address=127.0.0.2 \
+                --slave --retrieval-threads=4 --slave=yes --superslave=yes --query-local-address=127.0.0.2 \
                 --slave-cycle-interval=300 --dname-processing &
 }