aboutsummaryrefslogtreecommitdiffstats
path: root/net/resolvers/basic.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-11-24 04:26:44 +0100
committerKim Alvefur <zash@zash.se>2019-11-24 04:26:44 +0100
commita5450086e824443cff04adc9ed5ec3cca8301151 (patch)
tree809447289957579a10205e56f740ec8e28d740bb /net/resolvers/basic.lua
parent34563dd70dfe21a8bfaedc7f34810b9c6d834be8 (diff)
downloadprosody-a5450086e824443cff04adc9ed5ec3cca8301151.tar.gz
prosody-a5450086e824443cff04adc9ed5ec3cca8301151.zip
net.resolvers.basic: Fix resolution of IPv6 literals (in brackets) (fixes #1459)
Diffstat (limited to 'net/resolvers/basic.lua')
-rw-r--r--net/resolvers/basic.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/resolvers/basic.lua b/net/resolvers/basic.lua
index e3a94382..93182fda 100644
--- a/net/resolvers/basic.lua
+++ b/net/resolvers/basic.lua
@@ -59,6 +59,9 @@ local function new(hostname, port, conn_type, extra)
local targets = nil;
local is_ip = inet_pton(hostname);
+ if not is_ip and hostname:sub(1,1) == '[' then
+ is_ip = inet_pton(hostname:sub(2,-2));
+ end
if is_ip then
if #is_ip == 16 then
targets = { { conn_type.."6", hostname, port, extra } };