]> granicus.if.org Git - pdns/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>
Sun, 29 Sep 2013 17:32:10 +0000 (19:32 +0200)
pdns/pdnssec.cc

index d4e4714bb7e2297c3c17cc0968e62e41351b26d5..365a30ee0e0757de55908a42a6d0a9d7003cdcf3 100644 (file)
@@ -354,11 +354,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;
@@ -396,6 +392,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()))) {
@@ -500,7 +502,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++) {