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: dnsdist-1.1.0~27^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ef3b6cd7719e968364f6ad7692ff4287829f37f1;p=thirdparty%2Fpdns.git 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. --- diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index 8c87337cbd..818ecb8b27 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;