From: spirillen <44526987+spirillen@users.noreply.github.com> Date: Mon, 14 Sep 2020 09:41:10 +0000 (+0200) Subject: Small rewrite of `addMasks(dofile` X-Git-Tag: rec-4.5.0-alpha0~12^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=000692788a003d11afbe24bd44387e5337f51517;p=thirdparty%2Fpdns.git Small rewrite of `addMasks(dofile` I have made this little rewrite to avoid other from pit falling into the same mistake I made myself, and read the existent code as a list of IP's inside `bad.ips`, and not a script returning pre-formatted IPs. --- diff --git a/pdns/recursordist/docs/lua-scripting/netmask.rst b/pdns/recursordist/docs/lua-scripting/netmask.rst index f50ad8f101..8508ec6c24 100644 --- a/pdns/recursordist/docs/lua-scripting/netmask.rst +++ b/pdns/recursordist/docs/lua-scripting/netmask.rst @@ -86,7 +86,7 @@ They can be matched against netmasks objects: nmg = newNMG() nmg:addMask("127.0.0.0/8") nmg:addMasks({"213.244.168.0/24", "130.161.0.0/16"}) - nmg:addMasks(dofile("bad.ips")) -- contains return {"ip1","ip2"..} + nmg:addMasks(dofile("bad-ips.lua")) -- a lua script that return {"ip1","ip2"..} if nmg:match(dq.remoteaddr) then print("Intercepting query from ", dq.remoteaddr)