# HG changeset patch # User Kim Alvefur # Date 1574566004 -3600 # Node ID fcfc8f4d14a83307a1a2a13f66515f0a4b45b49d # Parent 0d702ec77f0c56fdd2b2a806a02f71fe571935d3 net.resolvers.basic: Fix resolution of IPv6 literals (in brackets) (fixes #1459) diff -r 0d702ec77f0c -r fcfc8f4d14a8 net/resolvers/basic.lua --- a/net/resolvers/basic.lua Sun Nov 24 04:23:51 2019 +0100 +++ b/net/resolvers/basic.lua Sun Nov 24 04:26:44 2019 +0100 @@ -59,6 +59,9 @@ 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 } };