From ef3b6cd7719e968364f6ad7692ff4287829f37f1 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Tue, 13 Dec 2016 16:21:17 +0100 Subject: [PATCH] rec: Set the result to NoError before calling `preresolve` Otherwise `rq.rcode` needs to be set explicitly when handling the query from `preresolve`, which is not documented and wasn't the case before. --- pdns/pdns_recursor.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index 8c87337cb..818ecb8b2 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -740,7 +740,8 @@ void startDoResolve(void *p) bool variableAnswer = false; bool shouldNotValidate = false; - int res; + /* preresolve expects res (dq.rcode) to be set to RCode::NoError by default */ + int res = RCode::NoError; DNSFilterEngine::Policy appliedPolicy; DNSRecord spoofed; std::shared_ptr dq = nullptr; -- 2.49.0