From: Kees Monshouwer Date: Sun, 10 Feb 2019 22:25:49 +0000 (+0100) Subject: Do not compress the root X-Git-Tag: auth-4.2.0-beta1~28^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F7472%2Fhead;p=thirdparty%2Fpdns.git Do not compress the root --- diff --git a/pdns/dnswriter.cc b/pdns/dnswriter.cc index 02abb9f8a3..745e0387a1 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]); }