From 87e144366cf3ef6f2c57103ab3de5663ebecb2ac Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 4 Jul 2021 01:23:35 +0200 Subject: 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'. --- util/prosodyctl/check.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'util') 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 -- cgit v1.2.3