Permalink
Browse files

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 ef3b6cd)
  • Loading branch information...
1 parent 8fa6e6b commit bfb7e5d4fd03c868eb694cb5514a8a89b34a5d1f @rgacogne rgacogne committed Dec 13, 2016
Showing with 2 additions and 1 deletion.
  1. +2 −1 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) {

0 comments on commit bfb7e5d

Please sign in to comment.