From: Remi Gacogne Date: Tue, 2 Jul 2019 12:37:02 +0000 (+0200) Subject: Insert the new DNSRecord last in MOADNSParser so we can move it X-Git-Tag: dnsdist-1.4.0-rc1~71^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F8010%2Fhead;p=thirdparty%2Fpdns.git Insert the new DNSRecord last in MOADNSParser so we can move it --- diff --git a/pdns/dnsparser.cc b/pdns/dnsparser.cc index f89ff3f67a..1f33aac27a 100644 --- a/pdns/dnsparser.cc +++ b/pdns/dnsparser.cc @@ -278,8 +278,6 @@ void MOADNSParser::init(bool query, const std::string& packet) dr.d_content=DNSRecordContent::mastermake(dr, pr, d_header.opcode); } - d_answers.push_back(make_pair(dr, pr.getPosition() - sizeof(dnsheader))); - /* XXX: XPF records should be allowed after TSIG as soon as the actual XPF option code has been assigned: if (dr.d_place == DNSResourceRecord::ADDITIONAL && seenTSIG && dr.d_type != QType::XPF) */ @@ -295,6 +293,8 @@ void MOADNSParser::init(bool query, const std::string& packet) seenTSIG = true; d_tsigPos = recordStartPos; } + + d_answers.push_back(make_pair(std::move(dr), pr.getPosition() - sizeof(dnsheader))); } #if 0