aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2022-01-30 16:04:22 +0100
committerKim Alvefur <zash@zash.se>2022-01-30 16:04:22 +0100
commit26e4b841307559cf98089cd9917f20edb2b229f3 (patch)
treeb13ae70987bd1086df1c8e8eb642f7dd98531009 /util
parent8ebfaefcbbe3b068e4a3ebce82489a828760a4cf (diff)
downloadprosody-26e4b841307559cf98089cd9917f20edb2b229f3.tar.gz
prosody-26e4b841307559cf98089cd9917f20edb2b229f3.zip
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
Diffstat (limited to 'util')
-rw-r--r--util/prosodyctl/check.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/util/prosodyctl/check.lua b/util/prosodyctl/check.lua
index aa56bc48..06f44c06 100644
--- a/util/prosodyctl/check.lua
+++ b/util/prosodyctl/check.lua
@@ -608,8 +608,8 @@ local function check(arg)
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