aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-07-04 01:23:35 +0200
committerKim Alvefur <zash@zash.se>2021-07-04 01:23:35 +0200
commit87e144366cf3ef6f2c57103ab3de5663ebecb2ac (patch)
treed4e45ce38ed95755baa761063c6b2ad1c90edb57 /util
parent87167772cab6be6f0e74075d8212347f5e2cc698 (diff)
downloadprosody-87e144366cf3ef6f2c57103ab3de5663ebecb2ac.tar.gz
prosody-87e144366cf3ef6f2c57103ab3de5663ebecb2ac.zip
util.prosodyctl.check: Silence IP protocol mismatches when disabled
If you set 'use_ipv4 = false' then you probably don't care much for the host not resolving to the IPv4 address, and same with 'use_ipv6'.
Diffstat (limited to 'util')
-rw-r--r--util/prosodyctl/check.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/util/prosodyctl/check.lua b/util/prosodyctl/check.lua
index 4a25fc1b..8e331b25 100644
--- a/util/prosodyctl/check.lua
+++ b/util/prosodyctl/check.lua
@@ -471,6 +471,8 @@ local function check(arg)
end
end
+ local use_ipv4 = configmanager.get("*", "use_ipv4") ~= false;
+ local use_ipv6 = configmanager.get("*", "use_ipv6") ~= false;
for target_host in target_hosts do
local host_ok_v4, host_ok_v6;
do
@@ -511,10 +513,10 @@ local function check(arg)
end
local bad_protos = {}
- if not host_ok_v4 then
+ if use_ipv4 and not host_ok_v4 then
table.insert(bad_protos, "IPv4");
end
- if not host_ok_v6 then
+ if use_ipv6 and not host_ok_v6 then
table.insert(bad_protos, "IPv6");
end
if #bad_protos > 0 then