diff net/resolvers/basic.lua @ 14112:59064f0f8b4e

Merge 13.0->trunk
author Kim Alvefur <zash@zash.se>
date Tue, 24 Mar 2026 17:28:53 +0100
parents bc33a7269f5a 1cf6e3f49d10
children
line wrap: on
line diff
--- a/net/resolvers/basic.lua	Tue Mar 24 12:51:01 2026 +0000
+++ b/net/resolvers/basic.lua	Tue Mar 24 17:28:53 2026 +0100
@@ -73,6 +73,12 @@
 		return;
 	end
 
+	if not self.port then
+		self.last_error = "indeterminate port";
+		cb(nil);
+		return;
+	end
+
 	if not self.hostname then
 		self.last_error = "hostname failed IDNA";
 		cb(nil);
@@ -131,7 +137,7 @@
 	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 and port then
 		hostname = inet_ntop(is_ip);
 		if #is_ip == 16 then
 			targets = { { conn_type.."6", hostname, port, extra } };