From: Tomas Krizek Date: Wed, 1 Apr 2020 09:57:05 +0000 (+0200) Subject: modules/daf: fix pass, deny, drop and tc actions X-Git-Tag: v5.1.0~21^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7af4933871ca95d4028f2f1453b743fed0640bde;p=thirdparty%2Fknot-resolver.git modules/daf: fix pass, deny, drop and tc actions Previously, all those actions caused resolver to return SERVFAIL, because the lua code failed to evaluate. Notably, deny action now properly returns NXDOMAIN instead of SERVFAIL. The drop action still returns SERVFAIL. --- diff --git a/modules/daf/daf.lua b/modules/daf/daf.lua index 282d03e92..6cdf5dfec 100644 --- a/modules/daf/daf.lua +++ b/modules/daf/daf.lua @@ -6,7 +6,11 @@ if not policy then modules.load('policy') end -- Actions local actions = { - pass = 1, deny = 2, drop = 3, tc = 4, truncate = 4, + pass = function() return policy.PASS end, + deny = function () return policy.DENY end, + drop = function() return policy.DROP end, + tc = function() return policy.TC end, + truncate = function() return policy.TC end, forward = function (g) local addrs = {} local tok = g()