]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
fix a regression in axfr-rectify introduced by commit d86e1bf7
authorKees Monshouwer <mind04@monshouwer.org>
Thu, 23 Feb 2017 23:36:15 +0000 (00:36 +0100)
committermind04 <mind04@monshouwer.org>
Thu, 4 May 2017 21:18:28 +0000 (23:18 +0200)
pdns/tcpreceiver.cc

index a8088e318a16f1a2579a7eb89e96b457f9048e13..e588eabd6487ccc8526350b30e50d8c33b1a6bad 100644 (file)
@@ -767,9 +767,7 @@ int TCPNameserver::doAXFR(const DNSName &target, shared_ptr<DNSPacket> q, int ou
           rr.content = ip.content;
           rrs.push_back(rr);
         }
-      }
-      else {
-        rrs.push_back(rr);
+        continue;
       }
 
       if (rectify) {
@@ -782,6 +780,7 @@ int TCPNameserver::doAXFR(const DNSName &target, shared_ptr<DNSPacket> q, int ou
           continue;
         }
       }
+      rrs.push_back(rr);
     } else {
       if (rr.qtype.getCode())
         L<<Logger::Warning<<"Zone '"<<target<<"' contains out-of-zone data '"<<rr.qname<<"|"<<rr.qtype.getName()<<"', ignoring"<<endl;
@@ -790,8 +789,8 @@ int TCPNameserver::doAXFR(const DNSName &target, shared_ptr<DNSPacket> q, int ou
   }
 
   // Group records by name and type, signpipe stumbles over interrupted rrsets
-  sort(zrrs.begin(), zrrs.end(), [](const DNSZoneRecord& a, const DNSZoneRecord& b) {
-    return tie(a.dr.d_name, a.dr.d_type) < tie(b.dr.d_name, b.dr.d_type);
+  sort(rrs.begin(), rrs.end(), [](const DNSResourceRecord& a, const DNSResourceRecord& b) {
+    return tie(a.qname, a.qtype) < tie(b.qname, b.qtype);
   });
 
   if(rectify) {