From: Otto Date: Fri, 26 Mar 2021 09:59:15 +0000 (+0100) Subject: Partial backport of #10111: Handle policy (if needed) after postresolve X-Git-Tag: rec-4.4.3~1^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F10227%2Fhead;p=thirdparty%2Fpdns.git Partial backport of #10111: Handle policy (if needed) after postresolve I did not take the Lua changes, as there is a (slight) chance they are disruptive. --- diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index 99a1952068..9bd6bf860b 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -1619,6 +1619,11 @@ static void startDoResolve(void *p) if (t_pdl && t_pdl->postresolve(dq, res)) { shouldNotValidate = true; + auto policyResult = handlePolicyHit(appliedPolicy, dc, sr, res, ret, pw); + // haveAnswer case redundant + if (policyResult == PolicyResult::Drop) { + return; + } } } }