Merge 0.11->trunk
authorKim Alvefur <zash@zash.se>
Sun, 24 Nov 2019 04:46:36 +0100
changeset 10445 f2c9abc71f08
parent 10444 1ee87b4979c2 (current diff)
parent 10443 97c0f5fe5f41 (diff)
child 10446 22db763c510c
Merge 0.11->trunk
net/resolvers/basic.lua
--- a/net/resolvers/basic.lua	Sun Nov 24 04:43:14 2019 +0100
+++ b/net/resolvers/basic.lua	Sun Nov 24 04:46:36 2019 +0100
@@ -1,5 +1,6 @@
 local adns = require "net.adns";
 local inet_pton = require "util.net".pton;
+local inet_ntop = require "util.net".ntop;
 local idna_to_ascii = require "util.encodings".idna.to_ascii;
 local unpack = table.unpack or unpack; -- luacheck: ignore 113
 
@@ -64,6 +65,7 @@
 		is_ip = inet_pton(hostname:sub(2,-2));
 	end
 	if is_ip then
+		hostname = inet_ntop(is_ip);
 		if #is_ip == 16 then
 			targets = { { conn_type.."6", hostname, port, extra } };
 		elseif #is_ip == 4 then