]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Do not compress the root 7607/head
authorKees Monshouwer <mind04@monshouwer.org>
Sun, 10 Feb 2019 22:25:49 +0000 (23:25 +0100)
committerErik Winkels <erik.winkels@powerdns.com>
Thu, 21 Mar 2019 11:27:14 +0000 (12:27 +0100)
(cherry picked from commit 2d6c4fcb18ec7ae1ef689656ce6d52b399cc26a9)

pdns/dnswriter.cc

index 916a23b9958ed866630e8cfe8bb7e2a51e5db80b..0721bb03fb648bef8a2c20e15e6d0a06c75e7d81 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]);
   }