diff net/resolvers/service.lua @ 14111:1cf6e3f49d10 13.0

net.resolvers: Fix to avoid SRV lookups for IP addresses SRV lookups of the form _service._tcp.192.0.0.8 IN SRV makes no sense. Problem was, what would a service without a default port do? Now this problem belongs to the basic resolver, which gets to return the error.
author Kim Alvefur <zash@zash.se>
date Tue, 24 Mar 2026 16:34:06 +0100
parents ba409c67353b
children
line wrap: on
line diff
--- a/net/resolvers/service.lua	Tue Jan 13 07:13:25 2026 +0100
+++ b/net/resolvers/service.lua	Tue Mar 24 16:34:06 2026 +0100
@@ -154,8 +154,8 @@
 	if not is_ip and hostname:sub(1,1) == '[' then
 		is_ip = inet_pton(hostname:sub(2,-2));
 	end
-	if is_ip and extra and extra.default_port then
-		return basic.new(hostname, extra.default_port, conn_type, extra);
+	if is_ip then
+		return basic.new(hostname, extra and extra.default_port, conn_type, extra);
 	end
 
 	return setmetatable({