From 9fe4c804c1298586a727f820ff718ca3e1042af5 Mon Sep 17 00:00:00 2001 From: cgielen Date: Wed, 14 Aug 2019 14:01:13 +0200 Subject: [PATCH] wrap ipv6-adresses in brackets --- lualib/lua_redis.lua | 9 +++++++++ 1 file changed, 9 insertions(+) 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 -- 2.39.5