From: cgielen Date: Wed, 14 Aug 2019 12:01:13 +0000 (+0200) Subject: wrap ipv6-adresses in brackets X-Git-Tag: 2.0~422^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9fe4c804c1298586a727f820ff718ca3e1042af5;p=rspamd.git wrap ipv6-adresses in brackets --- 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