]> granicus.if.org Git - pdns/commitdiff
auth: some small rectify improvements
authorKees Monshouwer <mind04@monshouwer.org>
Sun, 4 Jun 2017 11:29:48 +0000 (13:29 +0200)
committermind04 <mind04@monshouwer.org>
Mon, 12 Jun 2017 19:21:15 +0000 (21:21 +0200)
pdns/pdnsutil.cc
pdns/tcpreceiver.cc

index 852eb53e98a590bfed035971f7f3e6232c6a2a13..b4f80ab986db939a2d13ef4280ec32bc3a42c314 100644 (file)
@@ -156,7 +156,6 @@ bool rectifyZone(DNSSECKeeper& dk, const DNSName& zone)
   DNSResourceRecord rr;
   set<DNSName> qnames, nsset, dsnames, insnonterm, delnonterm;
   map<DNSName,bool> nonterm;
-  bool doent=true;
   vector<DNSResourceRecord> rrs;
 
   while(sd.db->get(rr)) {
@@ -171,8 +170,7 @@ bool rectifyZone(DNSSECKeeper& dk, const DNSName& zone)
         dsnames.insert(rr.qname);
     }
     else
-      if(doent)
-        delnonterm.insert(rr.qname);
+      delnonterm.insert(rr.qname);
   }
 
   NSEC3PARAMRecordContent ns3pr;
@@ -223,6 +221,7 @@ bool rectifyZone(DNSSECKeeper& dk, const DNSName& zone)
     sd.db->startTransaction(zone, -1);
 
   bool realrr=true;
+  bool doent=true;
   uint32_t maxent = ::arg().asNum("max-ent-entries");
 
   dononterm:;
index 58e1622e020e7221268dcd7d8c00b46028d24cf8..b3d718ce44392702ef1a922627261efb7fd8ae45 100644 (file)
@@ -821,10 +821,10 @@ int TCPNameserver::doAXFR(const DNSName &target, shared_ptr<DNSPacket> q, int ou
         DNSName shorter(zrr.dr.d_name);
         do {
           if (shorter==target) // apex is always auth
-            continue;
+            break;
           if(nsset.count(shorter) && !(zrr.dr.d_name==shorter && zrr.dr.d_type == QType::DS)) {
             zrr.auth=false;
-            continue;
+            break;
           }
         } while(shorter.chopOff());
       }
@@ -872,7 +872,7 @@ int TCPNameserver::doAXFR(const DNSName &target, shared_ptr<DNSPacket> q, int ou
       for(const auto& nt :  nonterm) {
         DNSZoneRecord zrr;
         zrr.dr.d_name=nt;
-        zrr.dr.d_type=0; // was TYPE0
+        zrr.dr.d_type=QType::ENT;
         zrr.auth=true;
         zrrs.push_back(zrr);
       }