aboutsummaryrefslogtreecommitdiffstats
path: root/lualib
diff options
context:
space:
mode:
authorcgielen <c.gielen@uvt.nl>2019-08-14 14:01:13 +0200
committercgielen <c.gielen@uvt.nl>2019-08-14 14:01:13 +0200
commit9fe4c804c1298586a727f820ff718ca3e1042af5 (patch)
treefd46055b3bc10c6bfa43eaef7d269e48be0279ea /lualib
parentb374f222fe50e1c957e9398b40de9e780f23addf (diff)
downloadrspamd-9fe4c804c1298586a727f820ff718ca3e1042af5.tar.gz
rspamd-9fe4c804c1298586a727f820ff718ca3e1042af5.zip
wrap ipv6-adresses in brackets
Diffstat (limited to 'lualib')
-rw-r--r--lualib/lua_redis.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/lualib/lua_redis.lua b/lualib/lua_redis.lua
index f3ff6d400..27ac53478 100644
--- a/lualib/lua_redis.lua
+++ b/lualib/lua_redis.lua
@@ -92,6 +92,11 @@ local function redis_query_sentinel(ev_base, params, initialised)
for _,m in ipairs(result) do
local master = flatten_redis_table(m)
+ -- Wrap IPv6-adresses in brackets
+ if (master.ip:match(":")) then
+ master.ip = "["..master.ip.."]"
+ end
+
if params.sentinel_masters_pattern then
if master.name:match(params.sentinel_masters_pattern) then
lutil.debugm(N, 'found master %s with ip %s and port %s',
@@ -122,6 +127,10 @@ local function redis_query_sentinel(ev_base, params, initialised)
lutil.debugm(N, rspamd_config,
'found slave form master %s with ip %s and port %s',
v.name, slave.ip, slave.port)
+ -- Wrap IPv6-adresses in brackets
+ if (slave.ip:match(":")) then
+ slave.ip = "["..slave.ip.."]"
+ end
v.slaves[#v.slaves + 1] = slave
end
end