]> granicus.if.org Git - pdns/commitdiff
Small optimization in deletion of 'deep' record
authorRuben d'Arco <cyclops@prof-x.net>
Sun, 10 Mar 2013 11:49:40 +0000 (12:49 +0100)
committermind04 <mind04@monshouwer.org>
Fri, 12 Jul 2013 15:26:18 +0000 (17:26 +0200)
pdns/rfc2136handler.cc
regression-tests/1dyndns-update-deep-add-delete/command [new file with mode: 0755]
regression-tests/1dyndns-update-deep-add-delete/description [new file with mode: 0644]
regression-tests/1dyndns-update-deep-add-delete/expected_result [new file with mode: 0644]
regression-tests/1dyndns-update-deep-add-delete/expected_result.narrow [new file with mode: 0644]
regression-tests/1dyndns-update-deep-add-delete/expected_result.nsec3 [new file with mode: 0644]
regression-tests/1dyndns-update-deep-add-delete/skip.nodyndns [new file with mode: 0644]

index 1ea49ca97a8011e14ba716d7fa391dbc44ee82aa..826f4f1416ba978d494f1db0c03857b10563bbbd 100755 (executable)
@@ -378,33 +378,48 @@ uint16_t PacketHandler::performUpdate(const string &msgPrefix, const DNSRecord *
       // We must check if we have a record below the current level and if we removed the 'last' record
       // on that level. If so, we must insert an ENT record.
       // We take extra care here to not 'include' the record that we just deleted. Some backends will still return it as they only reload on a commit.
-      bool foundDeeper = false, foundOther = false;
+      bool foundDeeper = false, foundOtherWithSameName = false;
       di->backend->listSubZone(rrLabel, di->id);
       while (di->backend->get(rec)) {
         if (rec.qname == rrLabel && !count(recordsToDelete.begin(), recordsToDelete.end(), rec))
-          foundOther = true;
+          foundOtherWithSameName = true;
         if (rec.qname != rrLabel)
           foundDeeper = true;
       }
 
-      if (foundDeeper && !foundOther) {
+      if (foundDeeper && !foundOtherWithSameName) {
         insnonterm.insert(rrLabel);
-      } else if (!foundOther) {
+      } else if (!foundOtherWithSameName) {
         // If we didn't have to insert an ENT, we might have deleted a record at very deep level
         // and we must then clean up the ENT's above the deleted record.
         string shorter(rrLabel);
-        do {
-          bool foundRealRR=false;
-          if (shorter == di->zone)
-            break;
-          // The reason for a listSubZone here is because might go up the tree and find the root ENT of another branch
+        while (shorter != di->zone) {
+          chopOff(shorter);
+          bool foundRealRR = false;
+
+          // The reason for a listSubZone here is because might go up the tree and find the ENT of another branch
           // consider these non ENT-records:
-          // a.b.c.d.e.test.com
-          // a.b.d.e.test.com
-          // if we delete a.b.c.d.e.test.com, we go up to d.e.test.com and then find a.b.d.e.test.com
+          // b.c.d.e.test.com
+          // b.d.e.test.com
+          // if we delete b.c.d.e.test.com, we go up to d.e.test.com and then find b.d.e.test.com because that's below d.e.test.com.
           // At that point we can stop deleting ENT's because the tree is in tact again.
-          //TODO: I think we do not need listSubZone() here, as we're moving up the tree with the chopOff(); i consider the listSubZone query more expensive and a lookup would be better.
           di->backend->listSubZone(shorter, di->id);
+          while (di->backend->get(rec)) {
+            if (rec.qtype.getCode())
+              foundRealRR = true;
+          }
+          if (!foundRealRR)
+            delnonterm.insert(shorter);
+          else
+            break;
+        }
+
+/*        do {
+          bool foundRealRR=false;
+          if (shorter == di->zone)
+            break; //we're at the top.
+
+          di->backend->lookup(QType(QType::ANY), shorter);
           while (di->backend->get(rec)) {
             if (rec.qtype.getCode())
               foundRealRR=true;
@@ -413,7 +428,7 @@ uint16_t PacketHandler::performUpdate(const string &msgPrefix, const DNSRecord *
             delnonterm.insert(shorter);
           else
             break; // we found a real record - tree is ok again.
-        }while(chopOff(shorter));
+        }while(chopOff(shorter));*/
       }
     }
   }
diff --git a/regression-tests/1dyndns-update-deep-add-delete/command b/regression-tests/1dyndns-update-deep-add-delete/command
new file mode 100755 (executable)
index 0000000..66d14fa
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+cleandig a.b.c.d.e.f.test.dyndns A hidesoadetails dnssec
+cleandig a.b.d.e.f.test.dyndns A hidesoadetails dnssec
+cleandig x.d.e.f.test.dyndns A hidesoadetails dnssec
+
+cleannsupdate <<!
+server $nameserver $port
+zone test.dyndns
+update add a.b.c.d.e.f.test.dyndns. 3600 A 127.0.0.1
+update add a.b.d.e.f.test.dyndns. 3600 A 127.0.0.1
+send
+answer
+!
+
+cleandig a.b.c.d.e.f.test.dyndns A hidesoadetails dnssec
+cleandig a.b.d.e.f.test.dyndns A hidesoadetails dnssec
+cleandig x.d.e.f.test.dyndns A hidesoadetails dnssec
+
+cleannsupdate <<!
+server $nameserver $port
+zone test.dyndns
+update delete a.b.c.d.e.f.test.dyndns. 3600 A 127.0.0.1
+update delete a.b.d.e.f.test.dyndns. 3600 A 127.0.0.1
+send
+answer
+!
+
+cleandig a.b.c.d.e.f.test.dyndns A hidesoadetails dnssec
+cleandig a.b.d.e.f.test.dyndns A hidesoadetails dnssec
+cleandig x.d.e.f.test.dyndns A hidesoadetails dnssec
\ No newline at end of file
diff --git a/regression-tests/1dyndns-update-deep-add-delete/description b/regression-tests/1dyndns-update-deep-add-delete/description
new file mode 100644 (file)
index 0000000..3be7525
--- /dev/null
@@ -0,0 +1,2 @@
+This test performs a simple add and delete of an A-record on a very deep level, which should cause ENT's to be inserted.
+
diff --git a/regression-tests/1dyndns-update-deep-add-delete/expected_result b/regression-tests/1dyndns-update-deep-add-delete/expected_result
new file mode 100644 (file)
index 0000000..70ab516
--- /dev/null
@@ -0,0 +1,85 @@
+1      delete-add.test.dyndns. IN      NSEC    86400   a.host.test.dyndns. A TXT RRSIG NSEC
+1      delete-add.test.dyndns. IN      RRSIG   86400   NSEC 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      NSEC    86400   cname1.test.dyndns. NS SOA MX RRSIG NSEC DNSKEY
+1      test.dyndns.    IN      RRSIG   3600    SOA 8 2 3600 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      RRSIG   86400   NSEC 8 2 86400 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      SOA     3600    ns1.test.dyndns. ahu.example.dyndns. [serial] 28800 7200 604800 86400
+2      .       IN      OPT     32768   
+Rcode: 3, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='a.b.c.d.e.f.test.dyndns.', qtype=A
+1      delete-add.test.dyndns. IN      NSEC    86400   a.host.test.dyndns. A TXT RRSIG NSEC
+1      delete-add.test.dyndns. IN      RRSIG   86400   NSEC 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      NSEC    86400   cname1.test.dyndns. NS SOA MX RRSIG NSEC DNSKEY
+1      test.dyndns.    IN      RRSIG   3600    SOA 8 2 3600 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      RRSIG   86400   NSEC 8 2 86400 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      SOA     3600    ns1.test.dyndns. ahu.example.dyndns. [serial] 28800 7200 604800 86400
+2      .       IN      OPT     32768   
+Rcode: 3, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='a.b.d.e.f.test.dyndns.', qtype=A
+1      delete-add.test.dyndns. IN      NSEC    86400   a.host.test.dyndns. A TXT RRSIG NSEC
+1      delete-add.test.dyndns. IN      RRSIG   86400   NSEC 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      NSEC    86400   cname1.test.dyndns. NS SOA MX RRSIG NSEC DNSKEY
+1      test.dyndns.    IN      RRSIG   3600    SOA 8 2 3600 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      RRSIG   86400   NSEC 8 2 86400 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      SOA     3600    ns1.test.dyndns. ahu.example.dyndns. [serial] 28800 7200 604800 86400
+2      .       IN      OPT     32768   
+Rcode: 3, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='x.d.e.f.test.dyndns.', qtype=A
+Answer:
+;; ->>HEADER<<- opcode: UPDATE, status: NOERROR, id: [id]
+;; flags: qr aa; ZONE: 1, PREREQ: 0, UPDATE: 0, ADDITIONAL: 0
+;; ZONE SECTION:
+;test.dyndns.                  IN      SOA
+
+0      a.b.c.d.e.f.test.dyndns.        IN      A       3600    127.0.0.1
+0      a.b.c.d.e.f.test.dyndns.        IN      RRSIG   3600    A 8 8 3600 [expiry] [inception] [keytag] test.dyndns. ...
+2      .       IN      OPT     32768   
+Rcode: 0, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='a.b.c.d.e.f.test.dyndns.', qtype=A
+0      a.b.d.e.f.test.dyndns.  IN      A       3600    127.0.0.1
+0      a.b.d.e.f.test.dyndns.  IN      RRSIG   3600    A 8 7 3600 [expiry] [inception] [keytag] test.dyndns. ...
+2      .       IN      OPT     32768   
+Rcode: 0, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='a.b.d.e.f.test.dyndns.', qtype=A
+1      a.b.c.d.e.f.test.dyndns.        IN      NSEC    86400   a.host.test.dyndns. A RRSIG NSEC
+1      a.b.c.d.e.f.test.dyndns.        IN      RRSIG   86400   NSEC 8 8 86400 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      NSEC    86400   cname1.test.dyndns. NS SOA MX RRSIG NSEC DNSKEY
+1      test.dyndns.    IN      RRSIG   3600    SOA 8 2 3600 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      RRSIG   86400   NSEC 8 2 86400 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      SOA     3600    ns1.test.dyndns. ahu.example.dyndns. [serial] 28800 7200 604800 86400
+2      .       IN      OPT     32768   
+Rcode: 3, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='x.d.e.f.test.dyndns.', qtype=A
+Answer:
+;; ->>HEADER<<- opcode: UPDATE, status: NOERROR, id: [id]
+;; flags: qr aa; ZONE: 1, PREREQ: 0, UPDATE: 0, ADDITIONAL: 0
+;; ZONE SECTION:
+;test.dyndns.                  IN      SOA
+
+1      delete-add.test.dyndns. IN      NSEC    86400   a.host.test.dyndns. A TXT RRSIG NSEC
+1      delete-add.test.dyndns. IN      RRSIG   86400   NSEC 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      NSEC    86400   cname1.test.dyndns. NS SOA MX RRSIG NSEC DNSKEY
+1      test.dyndns.    IN      RRSIG   3600    SOA 8 2 3600 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      RRSIG   86400   NSEC 8 2 86400 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      SOA     3600    ns1.test.dyndns. ahu.example.dyndns. [serial] 28800 7200 604800 86400
+2      .       IN      OPT     32768   
+Rcode: 3, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='a.b.c.d.e.f.test.dyndns.', qtype=A
+1      delete-add.test.dyndns. IN      NSEC    86400   a.host.test.dyndns. A TXT RRSIG NSEC
+1      delete-add.test.dyndns. IN      RRSIG   86400   NSEC 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      NSEC    86400   cname1.test.dyndns. NS SOA MX RRSIG NSEC DNSKEY
+1      test.dyndns.    IN      RRSIG   3600    SOA 8 2 3600 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      RRSIG   86400   NSEC 8 2 86400 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      SOA     3600    ns1.test.dyndns. ahu.example.dyndns. [serial] 28800 7200 604800 86400
+2      .       IN      OPT     32768   
+Rcode: 3, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='a.b.d.e.f.test.dyndns.', qtype=A
+1      delete-add.test.dyndns. IN      NSEC    86400   a.host.test.dyndns. A TXT RRSIG NSEC
+1      delete-add.test.dyndns. IN      RRSIG   86400   NSEC 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      NSEC    86400   cname1.test.dyndns. NS SOA MX RRSIG NSEC DNSKEY
+1      test.dyndns.    IN      RRSIG   3600    SOA 8 2 3600 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      RRSIG   86400   NSEC 8 2 86400 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      SOA     3600    ns1.test.dyndns. ahu.example.dyndns. [serial] 28800 7200 604800 86400
+2      .       IN      OPT     32768   
+Rcode: 3, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='x.d.e.f.test.dyndns.', qtype=A
diff --git a/regression-tests/1dyndns-update-deep-add-delete/expected_result.narrow b/regression-tests/1dyndns-update-deep-add-delete/expected_result.narrow
new file mode 100644 (file)
index 0000000..9669885
--- /dev/null
@@ -0,0 +1,99 @@
+1      epfp6242bi1891c397kjdhsd0h04otmr.test.dyndns.   IN      NSEC3   86400   1 1 1 abcd EPFP6242BI1891C397KJDHSD0H04OTMT
+1      epfp6242bi1891c397kjdhsd0h04otmr.test.dyndns.   IN      RRSIG   86400   NSEC3 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+1      otdrjsdlb78jmsu0ic15a7u25quqphhr.test.dyndns.   IN      NSEC3   86400   1 1 1 abcd OTDRJSDLB78JMSU0IC15A7U25QUQPHHT
+1      otdrjsdlb78jmsu0ic15a7u25quqphhr.test.dyndns.   IN      RRSIG   86400   NSEC3 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      RRSIG   3600    SOA 8 2 3600 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      SOA     3600    ns1.test.dyndns. ahu.example.dyndns. [serial] 28800 7200 604800 86400
+1      u36f0tjooqv1kspatto6qns0vap731v2.test.dyndns.   IN      NSEC3   86400   1 1 1 abcd U36F0TJOOQV1KSPATTO6QNS0VAP731V3 NS SOA MX RRSIG DNSKEY NSEC3PARAM
+1      u36f0tjooqv1kspatto6qns0vap731v2.test.dyndns.   IN      RRSIG   86400   NSEC3 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+2      .       IN      OPT     32768   
+Rcode: 3, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='a.b.c.d.e.f.test.dyndns.', qtype=A
+1      epfp6242bi1891c397kjdhsd0h04otmr.test.dyndns.   IN      NSEC3   86400   1 1 1 abcd EPFP6242BI1891C397KJDHSD0H04OTMT
+1      epfp6242bi1891c397kjdhsd0h04otmr.test.dyndns.   IN      RRSIG   86400   NSEC3 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+1      otdrjsdlb78jmsu0ic15a7u25quqphhr.test.dyndns.   IN      NSEC3   86400   1 1 1 abcd OTDRJSDLB78JMSU0IC15A7U25QUQPHHT
+1      otdrjsdlb78jmsu0ic15a7u25quqphhr.test.dyndns.   IN      RRSIG   86400   NSEC3 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      RRSIG   3600    SOA 8 2 3600 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      SOA     3600    ns1.test.dyndns. ahu.example.dyndns. [serial] 28800 7200 604800 86400
+1      u36f0tjooqv1kspatto6qns0vap731v2.test.dyndns.   IN      NSEC3   86400   1 1 1 abcd U36F0TJOOQV1KSPATTO6QNS0VAP731V3 NS SOA MX RRSIG DNSKEY NSEC3PARAM
+1      u36f0tjooqv1kspatto6qns0vap731v2.test.dyndns.   IN      RRSIG   86400   NSEC3 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+2      .       IN      OPT     32768   
+Rcode: 3, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='a.b.d.e.f.test.dyndns.', qtype=A
+1      epfp6242bi1891c397kjdhsd0h04otmr.test.dyndns.   IN      NSEC3   86400   1 1 1 abcd EPFP6242BI1891C397KJDHSD0H04OTMT
+1      epfp6242bi1891c397kjdhsd0h04otmr.test.dyndns.   IN      RRSIG   86400   NSEC3 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+1      otdrjsdlb78jmsu0ic15a7u25quqphhr.test.dyndns.   IN      NSEC3   86400   1 1 1 abcd OTDRJSDLB78JMSU0IC15A7U25QUQPHHT
+1      otdrjsdlb78jmsu0ic15a7u25quqphhr.test.dyndns.   IN      RRSIG   86400   NSEC3 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      RRSIG   3600    SOA 8 2 3600 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      SOA     3600    ns1.test.dyndns. ahu.example.dyndns. [serial] 28800 7200 604800 86400
+1      u36f0tjooqv1kspatto6qns0vap731v2.test.dyndns.   IN      NSEC3   86400   1 1 1 abcd U36F0TJOOQV1KSPATTO6QNS0VAP731V3 NS SOA MX RRSIG DNSKEY NSEC3PARAM
+1      u36f0tjooqv1kspatto6qns0vap731v2.test.dyndns.   IN      RRSIG   86400   NSEC3 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+2      .       IN      OPT     32768   
+Rcode: 3, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='x.d.e.f.test.dyndns.', qtype=A
+Answer:
+;; ->>HEADER<<- opcode: UPDATE, status: NOERROR, id: [id]
+;; flags: qr aa; ZONE: 1, PREREQ: 0, UPDATE: 0, ADDITIONAL: 0
+;; ZONE SECTION:
+;test.dyndns.                  IN      SOA
+
+0      a.b.c.d.e.f.test.dyndns.        IN      A       3600    127.0.0.1
+0      a.b.c.d.e.f.test.dyndns.        IN      RRSIG   3600    A 8 8 3600 [expiry] [inception] [keytag] test.dyndns. ...
+2      .       IN      OPT     32768   
+Rcode: 0, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='a.b.c.d.e.f.test.dyndns.', qtype=A
+0      a.b.d.e.f.test.dyndns.  IN      A       3600    127.0.0.1
+0      a.b.d.e.f.test.dyndns.  IN      RRSIG   3600    A 8 7 3600 [expiry] [inception] [keytag] test.dyndns. ...
+2      .       IN      OPT     32768   
+Rcode: 0, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='a.b.d.e.f.test.dyndns.', qtype=A
+1      epfp6242bi1891c397kjdhsd0h04otmr.test.dyndns.   IN      NSEC3   86400   1 1 1 abcd EPFP6242BI1891C397KJDHSD0H04OTMT
+1      epfp6242bi1891c397kjdhsd0h04otmr.test.dyndns.   IN      RRSIG   86400   NSEC3 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+1      otdrjsdlb78jmsu0ic15a7u25quqphhr.test.dyndns.   IN      NSEC3   86400   1 1 1 abcd OTDRJSDLB78JMSU0IC15A7U25QUQPHHT
+1      otdrjsdlb78jmsu0ic15a7u25quqphhr.test.dyndns.   IN      RRSIG   86400   NSEC3 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      RRSIG   3600    SOA 8 2 3600 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      SOA     3600    ns1.test.dyndns. ahu.example.dyndns. [serial] 28800 7200 604800 86400
+1      u36f0tjooqv1kspatto6qns0vap731v2.test.dyndns.   IN      NSEC3   86400   1 1 1 abcd U36F0TJOOQV1KSPATTO6QNS0VAP731V3 NS SOA MX RRSIG DNSKEY NSEC3PARAM
+1      u36f0tjooqv1kspatto6qns0vap731v2.test.dyndns.   IN      RRSIG   86400   NSEC3 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+2      .       IN      OPT     32768   
+Rcode: 3, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='x.d.e.f.test.dyndns.', qtype=A
+Answer:
+;; ->>HEADER<<- opcode: UPDATE, status: NOERROR, id: [id]
+;; flags: qr aa; ZONE: 1, PREREQ: 0, UPDATE: 0, ADDITIONAL: 0
+;; ZONE SECTION:
+;test.dyndns.                  IN      SOA
+
+1      epfp6242bi1891c397kjdhsd0h04otmr.test.dyndns.   IN      NSEC3   86400   1 1 1 abcd EPFP6242BI1891C397KJDHSD0H04OTMT
+1      epfp6242bi1891c397kjdhsd0h04otmr.test.dyndns.   IN      RRSIG   86400   NSEC3 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+1      otdrjsdlb78jmsu0ic15a7u25quqphhr.test.dyndns.   IN      NSEC3   86400   1 1 1 abcd OTDRJSDLB78JMSU0IC15A7U25QUQPHHT
+1      otdrjsdlb78jmsu0ic15a7u25quqphhr.test.dyndns.   IN      RRSIG   86400   NSEC3 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      RRSIG   3600    SOA 8 2 3600 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      SOA     3600    ns1.test.dyndns. ahu.example.dyndns. [serial] 28800 7200 604800 86400
+1      u36f0tjooqv1kspatto6qns0vap731v2.test.dyndns.   IN      NSEC3   86400   1 1 1 abcd U36F0TJOOQV1KSPATTO6QNS0VAP731V3 NS SOA MX RRSIG DNSKEY NSEC3PARAM
+1      u36f0tjooqv1kspatto6qns0vap731v2.test.dyndns.   IN      RRSIG   86400   NSEC3 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+2      .       IN      OPT     32768   
+Rcode: 3, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='a.b.c.d.e.f.test.dyndns.', qtype=A
+1      epfp6242bi1891c397kjdhsd0h04otmr.test.dyndns.   IN      NSEC3   86400   1 1 1 abcd EPFP6242BI1891C397KJDHSD0H04OTMT
+1      epfp6242bi1891c397kjdhsd0h04otmr.test.dyndns.   IN      RRSIG   86400   NSEC3 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+1      otdrjsdlb78jmsu0ic15a7u25quqphhr.test.dyndns.   IN      NSEC3   86400   1 1 1 abcd OTDRJSDLB78JMSU0IC15A7U25QUQPHHT
+1      otdrjsdlb78jmsu0ic15a7u25quqphhr.test.dyndns.   IN      RRSIG   86400   NSEC3 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      RRSIG   3600    SOA 8 2 3600 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      SOA     3600    ns1.test.dyndns. ahu.example.dyndns. [serial] 28800 7200 604800 86400
+1      u36f0tjooqv1kspatto6qns0vap731v2.test.dyndns.   IN      NSEC3   86400   1 1 1 abcd U36F0TJOOQV1KSPATTO6QNS0VAP731V3 NS SOA MX RRSIG DNSKEY NSEC3PARAM
+1      u36f0tjooqv1kspatto6qns0vap731v2.test.dyndns.   IN      RRSIG   86400   NSEC3 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+2      .       IN      OPT     32768   
+Rcode: 3, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='a.b.d.e.f.test.dyndns.', qtype=A
+1      epfp6242bi1891c397kjdhsd0h04otmr.test.dyndns.   IN      NSEC3   86400   1 1 1 abcd EPFP6242BI1891C397KJDHSD0H04OTMT
+1      epfp6242bi1891c397kjdhsd0h04otmr.test.dyndns.   IN      RRSIG   86400   NSEC3 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+1      otdrjsdlb78jmsu0ic15a7u25quqphhr.test.dyndns.   IN      NSEC3   86400   1 1 1 abcd OTDRJSDLB78JMSU0IC15A7U25QUQPHHT
+1      otdrjsdlb78jmsu0ic15a7u25quqphhr.test.dyndns.   IN      RRSIG   86400   NSEC3 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      RRSIG   3600    SOA 8 2 3600 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      SOA     3600    ns1.test.dyndns. ahu.example.dyndns. [serial] 28800 7200 604800 86400
+1      u36f0tjooqv1kspatto6qns0vap731v2.test.dyndns.   IN      NSEC3   86400   1 1 1 abcd U36F0TJOOQV1KSPATTO6QNS0VAP731V3 NS SOA MX RRSIG DNSKEY NSEC3PARAM
+1      u36f0tjooqv1kspatto6qns0vap731v2.test.dyndns.   IN      RRSIG   86400   NSEC3 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+2      .       IN      OPT     32768   
+Rcode: 3, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='x.d.e.f.test.dyndns.', qtype=A
diff --git a/regression-tests/1dyndns-update-deep-add-delete/expected_result.nsec3 b/regression-tests/1dyndns-update-deep-add-delete/expected_result.nsec3
new file mode 100644 (file)
index 0000000..8962d57
--- /dev/null
@@ -0,0 +1,99 @@
+1      dsa3ti9nu3apdsvl3f63qlvakv555sr6.test.dyndns.   IN      NSEC3   86400   1 1 1 abcd FQU365VN7BR5CSV8CG6NE9V8HA6D008P A RRSIG
+1      dsa3ti9nu3apdsvl3f63qlvakv555sr6.test.dyndns.   IN      RRSIG   86400   NSEC3 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+1      lresbbp3lv8blgj9fsgtdmm4q7vj3d6j.test.dyndns.   IN      NSEC3   86400   1 1 1 abcd Q75PNOE7PB74PND6OGN44T5BTUURBHRF A RRSIG
+1      lresbbp3lv8blgj9fsgtdmm4q7vj3d6j.test.dyndns.   IN      RRSIG   86400   NSEC3 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      RRSIG   3600    SOA 8 2 3600 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      SOA     3600    ns1.test.dyndns. ahu.example.dyndns. [serial] 28800 7200 604800 86400
+1      u36f0tjooqv1kspatto6qns0vap731v2.test.dyndns.   IN      NSEC3   86400   1 1 1 abcd 2GP5RDNJOQ5OOSPC5O1IH9LALI101DI8 NS SOA MX RRSIG DNSKEY NSEC3PARAM
+1      u36f0tjooqv1kspatto6qns0vap731v2.test.dyndns.   IN      RRSIG   86400   NSEC3 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+2      .       IN      OPT     32768   
+Rcode: 3, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='a.b.c.d.e.f.test.dyndns.', qtype=A
+1      dsa3ti9nu3apdsvl3f63qlvakv555sr6.test.dyndns.   IN      NSEC3   86400   1 1 1 abcd FQU365VN7BR5CSV8CG6NE9V8HA6D008P A RRSIG
+1      dsa3ti9nu3apdsvl3f63qlvakv555sr6.test.dyndns.   IN      RRSIG   86400   NSEC3 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+1      lresbbp3lv8blgj9fsgtdmm4q7vj3d6j.test.dyndns.   IN      NSEC3   86400   1 1 1 abcd Q75PNOE7PB74PND6OGN44T5BTUURBHRF A RRSIG
+1      lresbbp3lv8blgj9fsgtdmm4q7vj3d6j.test.dyndns.   IN      RRSIG   86400   NSEC3 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      RRSIG   3600    SOA 8 2 3600 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      SOA     3600    ns1.test.dyndns. ahu.example.dyndns. [serial] 28800 7200 604800 86400
+1      u36f0tjooqv1kspatto6qns0vap731v2.test.dyndns.   IN      NSEC3   86400   1 1 1 abcd 2GP5RDNJOQ5OOSPC5O1IH9LALI101DI8 NS SOA MX RRSIG DNSKEY NSEC3PARAM
+1      u36f0tjooqv1kspatto6qns0vap731v2.test.dyndns.   IN      RRSIG   86400   NSEC3 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+2      .       IN      OPT     32768   
+Rcode: 3, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='a.b.d.e.f.test.dyndns.', qtype=A
+1      dsa3ti9nu3apdsvl3f63qlvakv555sr6.test.dyndns.   IN      NSEC3   86400   1 1 1 abcd FQU365VN7BR5CSV8CG6NE9V8HA6D008P A RRSIG
+1      dsa3ti9nu3apdsvl3f63qlvakv555sr6.test.dyndns.   IN      RRSIG   86400   NSEC3 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+1      lresbbp3lv8blgj9fsgtdmm4q7vj3d6j.test.dyndns.   IN      NSEC3   86400   1 1 1 abcd Q75PNOE7PB74PND6OGN44T5BTUURBHRF A RRSIG
+1      lresbbp3lv8blgj9fsgtdmm4q7vj3d6j.test.dyndns.   IN      RRSIG   86400   NSEC3 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      RRSIG   3600    SOA 8 2 3600 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      SOA     3600    ns1.test.dyndns. ahu.example.dyndns. [serial] 28800 7200 604800 86400
+1      u36f0tjooqv1kspatto6qns0vap731v2.test.dyndns.   IN      NSEC3   86400   1 1 1 abcd 2GP5RDNJOQ5OOSPC5O1IH9LALI101DI8 NS SOA MX RRSIG DNSKEY NSEC3PARAM
+1      u36f0tjooqv1kspatto6qns0vap731v2.test.dyndns.   IN      RRSIG   86400   NSEC3 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+2      .       IN      OPT     32768   
+Rcode: 3, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='x.d.e.f.test.dyndns.', qtype=A
+Answer:
+;; ->>HEADER<<- opcode: UPDATE, status: NOERROR, id: [id]
+;; flags: qr aa; ZONE: 1, PREREQ: 0, UPDATE: 0, ADDITIONAL: 0
+;; ZONE SECTION:
+;test.dyndns.                  IN      SOA
+
+0      a.b.c.d.e.f.test.dyndns.        IN      A       3600    127.0.0.1
+0      a.b.c.d.e.f.test.dyndns.        IN      RRSIG   3600    A 8 8 3600 [expiry] [inception] [keytag] test.dyndns. ...
+2      .       IN      OPT     32768   
+Rcode: 0, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='a.b.c.d.e.f.test.dyndns.', qtype=A
+0      a.b.d.e.f.test.dyndns.  IN      A       3600    127.0.0.1
+0      a.b.d.e.f.test.dyndns.  IN      RRSIG   3600    A 8 7 3600 [expiry] [inception] [keytag] test.dyndns. ...
+2      .       IN      OPT     32768   
+Rcode: 0, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='a.b.d.e.f.test.dyndns.', qtype=A
+1      dsa3ti9nu3apdsvl3f63qlvakv555sr6.test.dyndns.   IN      NSEC3   86400   1 1 1 abcd FQHG4B60ON9MNERF7BLIPAI4EJ9GKPDK A RRSIG
+1      dsa3ti9nu3apdsvl3f63qlvakv555sr6.test.dyndns.   IN      RRSIG   86400   NSEC3 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+1      lresbbp3lv8blgj9fsgtdmm4q7vj3d6j.test.dyndns.   IN      NSEC3   86400   1 1 1 abcd Q75PNOE7PB74PND6OGN44T5BTUURBHRF A RRSIG
+1      lresbbp3lv8blgj9fsgtdmm4q7vj3d6j.test.dyndns.   IN      RRSIG   86400   NSEC3 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      RRSIG   3600    SOA 8 2 3600 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      SOA     3600    ns1.test.dyndns. ahu.example.dyndns. [serial] 28800 7200 604800 86400
+1      u36f0tjooqv1kspatto6qns0vap731v2.test.dyndns.   IN      NSEC3   86400   1 1 1 abcd 2GP5RDNJOQ5OOSPC5O1IH9LALI101DI8 NS SOA MX RRSIG DNSKEY NSEC3PARAM
+1      u36f0tjooqv1kspatto6qns0vap731v2.test.dyndns.   IN      RRSIG   86400   NSEC3 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+2      .       IN      OPT     32768   
+Rcode: 3, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='x.d.e.f.test.dyndns.', qtype=A
+Answer:
+;; ->>HEADER<<- opcode: UPDATE, status: NOERROR, id: [id]
+;; flags: qr aa; ZONE: 1, PREREQ: 0, UPDATE: 0, ADDITIONAL: 0
+;; ZONE SECTION:
+;test.dyndns.                  IN      SOA
+
+1      dsa3ti9nu3apdsvl3f63qlvakv555sr6.test.dyndns.   IN      NSEC3   86400   1 1 1 abcd FQU365VN7BR5CSV8CG6NE9V8HA6D008P A RRSIG
+1      dsa3ti9nu3apdsvl3f63qlvakv555sr6.test.dyndns.   IN      RRSIG   86400   NSEC3 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+1      lresbbp3lv8blgj9fsgtdmm4q7vj3d6j.test.dyndns.   IN      NSEC3   86400   1 1 1 abcd Q75PNOE7PB74PND6OGN44T5BTUURBHRF A RRSIG
+1      lresbbp3lv8blgj9fsgtdmm4q7vj3d6j.test.dyndns.   IN      RRSIG   86400   NSEC3 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      RRSIG   3600    SOA 8 2 3600 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      SOA     3600    ns1.test.dyndns. ahu.example.dyndns. [serial] 28800 7200 604800 86400
+1      u36f0tjooqv1kspatto6qns0vap731v2.test.dyndns.   IN      NSEC3   86400   1 1 1 abcd 2GP5RDNJOQ5OOSPC5O1IH9LALI101DI8 NS SOA MX RRSIG DNSKEY NSEC3PARAM
+1      u36f0tjooqv1kspatto6qns0vap731v2.test.dyndns.   IN      RRSIG   86400   NSEC3 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+2      .       IN      OPT     32768   
+Rcode: 3, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='a.b.c.d.e.f.test.dyndns.', qtype=A
+1      dsa3ti9nu3apdsvl3f63qlvakv555sr6.test.dyndns.   IN      NSEC3   86400   1 1 1 abcd FQU365VN7BR5CSV8CG6NE9V8HA6D008P A RRSIG
+1      dsa3ti9nu3apdsvl3f63qlvakv555sr6.test.dyndns.   IN      RRSIG   86400   NSEC3 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+1      lresbbp3lv8blgj9fsgtdmm4q7vj3d6j.test.dyndns.   IN      NSEC3   86400   1 1 1 abcd Q75PNOE7PB74PND6OGN44T5BTUURBHRF A RRSIG
+1      lresbbp3lv8blgj9fsgtdmm4q7vj3d6j.test.dyndns.   IN      RRSIG   86400   NSEC3 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      RRSIG   3600    SOA 8 2 3600 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      SOA     3600    ns1.test.dyndns. ahu.example.dyndns. [serial] 28800 7200 604800 86400
+1      u36f0tjooqv1kspatto6qns0vap731v2.test.dyndns.   IN      NSEC3   86400   1 1 1 abcd 2GP5RDNJOQ5OOSPC5O1IH9LALI101DI8 NS SOA MX RRSIG DNSKEY NSEC3PARAM
+1      u36f0tjooqv1kspatto6qns0vap731v2.test.dyndns.   IN      RRSIG   86400   NSEC3 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+2      .       IN      OPT     32768   
+Rcode: 3, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='a.b.d.e.f.test.dyndns.', qtype=A
+1      dsa3ti9nu3apdsvl3f63qlvakv555sr6.test.dyndns.   IN      NSEC3   86400   1 1 1 abcd FQU365VN7BR5CSV8CG6NE9V8HA6D008P A RRSIG
+1      dsa3ti9nu3apdsvl3f63qlvakv555sr6.test.dyndns.   IN      RRSIG   86400   NSEC3 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+1      lresbbp3lv8blgj9fsgtdmm4q7vj3d6j.test.dyndns.   IN      NSEC3   86400   1 1 1 abcd Q75PNOE7PB74PND6OGN44T5BTUURBHRF A RRSIG
+1      lresbbp3lv8blgj9fsgtdmm4q7vj3d6j.test.dyndns.   IN      RRSIG   86400   NSEC3 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      RRSIG   3600    SOA 8 2 3600 [expiry] [inception] [keytag] test.dyndns. ...
+1      test.dyndns.    IN      SOA     3600    ns1.test.dyndns. ahu.example.dyndns. [serial] 28800 7200 604800 86400
+1      u36f0tjooqv1kspatto6qns0vap731v2.test.dyndns.   IN      NSEC3   86400   1 1 1 abcd 2GP5RDNJOQ5OOSPC5O1IH9LALI101DI8 NS SOA MX RRSIG DNSKEY NSEC3PARAM
+1      u36f0tjooqv1kspatto6qns0vap731v2.test.dyndns.   IN      RRSIG   86400   NSEC3 8 3 86400 [expiry] [inception] [keytag] test.dyndns. ...
+2      .       IN      OPT     32768   
+Rcode: 3, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='x.d.e.f.test.dyndns.', qtype=A
diff --git a/regression-tests/1dyndns-update-deep-add-delete/skip.nodyndns b/regression-tests/1dyndns-update-deep-add-delete/skip.nodyndns
new file mode 100644 (file)
index 0000000..81c071b
--- /dev/null
@@ -0,0 +1 @@
+Skip this test if the backend does not support dyndns/rfc2136