# HG changeset patch # User Ashley Ward # Date 1421751734 0 # Node ID 47fb4f36dacd414b271e45942afb9e1bbb99e044 # Parent 21e439ca72080aaea450e5566fa01fe319b558f2 Add support for IPv4 addresses in SRV injections diff -r 21e439ca7208 -r 47fb4f36dacd mod_srvinjection/mod_srvinjection.lua --- a/mod_srvinjection/mod_srvinjection.lua Sun Jan 18 01:21:53 2015 +0100 +++ b/mod_srvinjection/mod_srvinjection.lua Tue Jan 20 11:02:14 2015 +0000 @@ -32,9 +32,16 @@ handler(mapping); return; end - elseif qtype == "A" and (qname == "localhost." or qname == "127.0.0.1.") then - handler({{ a = "127.0.0.1" }}); - return; + elseif qtype == "A" then + if (qname == "localhost." or qname == "127.0.0.1.") then + handler({{ a = "127.0.0.1" }}); + return; + end + local ip = qname:match("^(%d+.%d+.%d+.%d+).$"); + if ip then + handler({{ a = ip }}); + return; + end end return original_lookup(handler, qname, qtype, qclass); end