From: Remi Gacogne Date: Tue, 13 Dec 2016 15:21:17 +0000 (+0100) Subject: rec: Set the result to NoError before calling `preresolve` X-Git-Tag: rec-4.0.4~8^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bfb7e5d4fd03c868eb694cb5514a8a89b34a5d1f;p=pdns 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) --- diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index 6663fd24c..5e73fbac3 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) {