From 5b863aad1831759c78a4f7299bf49efca5937bf3 Mon Sep 17 00:00:00 2001 From: Kees Monshouwer Date: Sun, 10 Feb 2019 23:25:49 +0100 Subject: [PATCH] Do not compress the root (cherry picked from commit 2d6c4fcb18ec7ae1ef689656ce6d52b399cc26a9) --- pdns/dnswriter.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdns/dnswriter.cc b/pdns/dnswriter.cc index 916a23b99..0721bb03f 100644 --- a/pdns/dnswriter.cc +++ b/pdns/dnswriter.cc @@ -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]); } -- 2.40.0