]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Small rewrite of `addMasks(dofile`
authorspirillen <44526987+spirillen@users.noreply.github.com>
Mon, 14 Sep 2020 09:41:10 +0000 (11:41 +0200)
committerGitHub <noreply@github.com>
Mon, 14 Sep 2020 09:41:10 +0000 (11:41 +0200)
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.

pdns/recursordist/docs/lua-scripting/netmask.rst

index f50ad8f101dc3134d28dc196b75480de98c8d605..8508ec6c24f7e842812c181646e92c0386f36d70 100644 (file)
@@ -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)