aboutsummaryrefslogtreecommitdiffstats
path: root/util/prosodyctl/check.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-11-20 17:05:32 +0100
committerKim Alvefur <zash@zash.se>2021-11-20 17:05:32 +0100
commit555740dd9629ccc4237a66abe48b078c9874eaea (patch)
tree7894dfc5b584c744737214a8eb3fdee12bc999ac /util/prosodyctl/check.lua
parent40ca2839e05b2de6debce45b6002fa0090154cd8 (diff)
downloadprosody-555740dd9629ccc4237a66abe48b078c9874eaea.tar.gz
prosody-555740dd9629ccc4237a66abe48b078c9874eaea.zip
util.prosodyctl.check: Respect use_ipv4/v6 in proxy65 check
Previously it would complain about lack of an AAAA record for proxy65_target even in an IPv6-less environment. Thanks to libertas for unintentionally calling attention to this.
Diffstat (limited to 'util/prosodyctl/check.lua')
-rw-r--r--util/prosodyctl/check.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/util/prosodyctl/check.lua b/util/prosodyctl/check.lua
index 73f3ced6..4a93d91c 100644
--- a/util/prosodyctl/check.lua
+++ b/util/prosodyctl/check.lua
@@ -456,6 +456,8 @@ local function check(arg)
end
local v6_supported = not not socket.tcp6;
+ local use_ipv4 = configmanager.get("*", "use_ipv4") ~= false;
+ local use_ipv6 = v6_supported and configmanager.get("*", "use_ipv6") ~= false;
local function trim_dns_name(n)
return (n:gsub("%.$", ""));
@@ -574,10 +576,10 @@ local function check(arg)
if type(proxy65_target) == "string" then
local A, AAAA = dns.lookup(idna.to_ascii(proxy65_target), "A"), dns.lookup(idna.to_ascii(proxy65_target), "AAAA");
local prob = {};
- if not A then
+ if use_ipv4 and not A then
table.insert(prob, "A");
end
- if v6_supported and not AAAA then
+ if use_ipv6 and not AAAA then
table.insert(prob, "AAAA");
end
if #prob > 0 then
@@ -589,8 +591,6 @@ local function check(arg)
end
end
- local use_ipv4 = configmanager.get("*", "use_ipv4") ~= false;
- local use_ipv6 = v6_supported and configmanager.get("*", "use_ipv6") ~= false;
if not use_ipv4 and not use_ipv6 then
print(" Both IPv6 and IPv4 are disabled, Prosody will not listen on any ports");
print(" nor be able to connect to any remote servers.");