From ce51bfe2fb86420140fc92f2cb5b7f0aa1cfaa85 Mon Sep 17 00:00:00 2001 From: Otto Date: Tue, 20 Jul 2021 14:10:18 +0200 Subject: [PATCH] Process potential Drop action after preresolve Lua hook. --- pdns/pdns_recursor.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index b325fbc8d3..d52e112ccf 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -1939,6 +1939,15 @@ static void startDoResolve(void *p) } } } + else if (t_pdl) { + // preresolve returned true + shouldNotValidate = true; + auto policyResult = handlePolicyHit(appliedPolicy, dc, sr, res, ret, pw); + // haveAnswer case redundant + if (policyResult == PolicyResult::Drop) { + return; + } + } haveAnswer:; if(tracedQuery || res == -1 || res == RCode::ServFail || pw.getHeader()->rcode == RCode::ServFail) -- 2.47.2