From c771b7120e8091a429cd6458d9c1ad2eacdc3650 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Tue, 2 Jul 2019 14:37:02 +0200 Subject: [PATCH] Insert the new DNSRecord last in MOADNSParser so we can move it --- pdns/dnsparser.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pdns/dnsparser.cc b/pdns/dnsparser.cc index f89ff3f67..1f33aac27 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 -- 2.40.0