From bfb7e5d4fd03c868eb694cb5514a8a89b34a5d1f 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. (cherry picked from commit ef3b6cd7719e968364f6ad7692ff4287829f37f1) --- 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 6663fd24cd..5e73fbac32 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -739,7 +739,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; if(dc->d_mdp.d_qtype==QType::ANY && !dc->d_tcp && g_anyToTcp) { -- 2.47.2