]> granicus.if.org Git - pdns/commitdiff
ignore NSEC/NSEC3 records while loading bind zonefiles
authorPeter van Dijk <peter.van.dijk@netherlabs.nl>
Thu, 22 Nov 2012 15:00:55 +0000 (15:00 +0000)
committerPeter van Dijk <peter.van.dijk@netherlabs.nl>
Thu, 22 Nov 2012 15:00:55 +0000 (15:00 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@2917 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/backends/bind/bindbackend2.cc

index 3468c0abf1d584b52021de16ef5580d4322da9fc..61009f7ad5d8b12f7652fa7f0849216d1b8f79ca 100644 (file)
@@ -735,7 +735,10 @@ void Bind2Backend::loadConfig(string* status)
             ZoneParserTNG zpt(i->filename, i->name, BP.getDirectory());
             DNSResourceRecord rr;
             string hashed;
-            while(zpt.get(rr)) {
+            while(zpt.get(rr)) {  // FIXME this code is duplicate
+              if(rr.qtype.getCode() == QType::NSEC || rr.qtype.getCode() == QType::NSEC3)
+                continue; // we synthesise NSECs on demand
+
               if(nsec3zone) {
                 if(rr.qtype.getCode() != QType::NSEC3 && rr.qtype.getCode() != QType::RRSIG)
                   hashed=toLower(toBase32Hex(hashQNameWithSalt(ns3pr.d_iterations, ns3pr.d_salt, rr.qname)));
@@ -864,6 +867,9 @@ void Bind2Backend::queueReload(BB2DomainInfo *bbd)
     NSEC3PARAMRecordContent ns3pr;
     bool nsec3zone=getNSEC3PARAM(bbd->d_name, &ns3pr);
     while(zpt.get(rr)) {
+      if(rr.qtype.getCode() == QType::NSEC || rr.qtype.getCode() == QType::NSEC3)
+        continue; // we synthesise NSECs on demand
+
       if(nsec3zone) {
         if(rr.qtype.getCode() != QType::NSEC3 && rr.qtype.getCode() != QType::RRSIG)
           hashed=toLower(toBase32Hex(hashQNameWithSalt(ns3pr.d_iterations, ns3pr.d_salt, rr.qname)));