]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
modules/daf: fix pass, deny, drop and tc actions
authorTomas Krizek <tomas.krizek@nic.cz>
Wed, 1 Apr 2020 09:57:05 +0000 (11:57 +0200)
committerTomas Krizek <tomas.krizek@nic.cz>
Thu, 2 Apr 2020 11:57:33 +0000 (13:57 +0200)
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.

modules/daf/daf.lua

index 282d03e92b318097fd37d38104f6910cc290d7db..6cdf5dfecca38b7482f860fdb6e3c6f750f5ef96 100644 (file)
@@ -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()