]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
pdnssec check-zone, fix record counting and improve out of zone check
authorKees Monshouwer <mind04@monshouwer.org>
Sun, 29 Sep 2013 17:11:32 +0000 (19:11 +0200)
committermind04 <mind04@monshouwer.org>
Fri, 22 Nov 2013 08:07:08 +0000 (09:07 +0100)
pdns/pdnssec.cc

index 1ced8182f3aeb5bf23785332e39c575910ec8319..e8c0cae5436b913d0e7bbe7a9a0dbaadcc098fe3 100644 (file)
@@ -351,11 +351,7 @@ int checkZone(DNSSECKeeper &dk, UeberBackend &B, const std::string& zone)
     if(!rr.qtype.getCode())
       continue;
 
-    if(!endsOn(rr.qname, zone)) {
-      cout<<"[Warning] Record '"<<rr.qname<<" IN "<<rr.qtype.getName()<<" "<<rr.content<<"' in zone '"<<zone<<"' is out-of-zone."<<endl;
-      numwarnings++;
-      continue;
-    }
+    numrecords++;
 
     if(rr.qtype.getCode() == QType::SOA) {
       vector<string>parts;
@@ -393,6 +389,12 @@ int checkZone(DNSSECKeeper &dk, UeberBackend &B, const std::string& zone)
       continue;
     }
 
+    if(!endsOn(rr.qname, zone)) {
+      cout<<"[Warning] Record '"<<rr.qname<<" IN "<<rr.qtype.getName()<<" "<<rr.content<<"' in zone '"<<zone<<"' is out-of-zone."<<endl;
+      numwarnings++;
+      continue;
+    }
+
     content.str("");
     content<<rr.qname<<" "<<rr.qtype.getName()<<" "<<rr.content;
     if (records.count(toLower(content.str()))) {
@@ -497,7 +499,6 @@ int checkZone(DNSSECKeeper &dk, UeberBackend &B, const std::string& zone)
       cout<<"[Error] Following record is auth=0, run pdnssec rectify-zone?: "<<rr.qname<<" IN " <<rr.qtype.getName()<< " " << rr.content<<endl;
       numerrors++;
     }
-    numrecords++;
   }
 
   for(set<string>::const_iterator i = cnames.begin(); i != cnames.end(); i++) {