]> granicus.if.org Git - pdns/commitdiff
Do not compress the root
authorKees Monshouwer <mind04@monshouwer.org>
Sun, 10 Feb 2019 22:25:49 +0000 (23:25 +0100)
committermind04 <mind04@monshouwer.org>
Sun, 10 Feb 2019 22:25:49 +0000 (23:25 +0100)
pdns/dnswriter.cc

index 02abb9f8a34d2e6b7ff22ab2036b1386a2f69930..745e0387a193047652404b32e00adf60afa4f42b 100644 (file)
@@ -79,7 +79,7 @@ void DNSPacketWriter::startRecord(const DNSName& name, uint16_t qtype, uint32_t
   commit();
   d_rollbackmarker=d_content.size();
 
-  if(compress && !name.empty() && d_qname==name) {  // don't do the whole label compression thing if we *know* we can get away with "see question" - except when compressing the root
+  if(compress && !name.isRoot() && d_qname==name) {  // don't do the whole label compression thing if we *know* we can get away with "see question" - except when compressing the root
     static unsigned char marker[2]={0xc0, 0x0c};
     d_content.insert(d_content.end(), (const char *) &marker[0], (const char *) &marker[2]);
   }