From 8e6092d58a22c88cd97c15b6cefe60de8a53d307 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 1 Dec 2017 04:50:20 +0100 Subject: net.dns: Don't compress a single zero group in IPv6 addresses to match behaviour of inet_ntop --- net/dns.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'net') diff --git a/net/dns.lua b/net/dns.lua index 5ba3db0e..eba2b5a0 100644 --- a/net/dns.lua +++ b/net/dns.lua @@ -390,7 +390,7 @@ function resolver:AAAA(rr) end addr = table.concat(addr, ":"):gsub("%f[%x]0+(%x)","%1"); local zeros = {}; - for item in addr:gmatch(":[0:]+:") do + for item in addr:gmatch(":[0:]+:[0:]+:") do table.insert(zeros, item) end if #zeros == 0 then -- cgit v1.2.3