From: realPy Date: Mon, 30 Mar 2020 10:54:22 +0000 (+0200) Subject: daf: fix del method X-Git-Tag: v5.1.0~21^2~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b7258879f8910014ef9ec8facda3607b220e7b0;p=thirdparty%2Fknot-resolver.git daf: fix del method The id rule is not the same as the index of the array. Fixes: #553 --- diff --git a/modules/daf/daf.lua b/modules/daf/daf.lua index 0786d6d68..59f7ba8a8 100644 --- a/modules/daf/daf.lua +++ b/modules/daf/daf.lua @@ -176,10 +176,10 @@ end -- @function Remove a rule function M.del(id) - for _, r in ipairs(M.rules) do + for key, r in ipairs(M.rules) do if r.rule.id == id then policy.del(id) - table.remove(M.rules, id) + table.remove(M.rules, key) return true end end