Changeset

12231:ca8453129ade

util.prosodyctl.check: Fix A/AAAA check for proxy65 and http When there are no records to return the return value from dns.lookup() might be nil or might be a table containing zero records, depending on which DNS library is used
author Kim Alvefur <zash@zash.se>
date Sun, 30 Jan 2022 16:04:22 +0100
parents 12230:f590058d8d99
children 12232:4f5f34a7f85a
files util/prosodyctl/check.lua
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/util/prosodyctl/check.lua	Sun Jan 30 13:16:30 2022 +0100
+++ b/util/prosodyctl/check.lua	Sun Jan 30 16:04:22 2022 +0100
@@ -608,8 +608,8 @@
 			local function check_address(target)
 				local A, AAAA = dns.lookup(idna.to_ascii(target), "A"), dns.lookup(idna.to_ascii(target), "AAAA");
 				local prob = {};
-				if use_ipv4 and not A then table.insert(prob, "A"); end
-				if use_ipv6 and not AAAA then table.insert(prob, "AAAA"); end
+				if use_ipv4 and not (A and #A > 0) then table.insert(prob, "A"); end
+				if use_ipv6 and not (AAAA and #AAAA > 0) then table.insert(prob, "AAAA"); end
 				return prob;
 			end