aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2022-03-19 11:09:10 +0000
committerMatthew Wild <mwild1@gmail.com>2022-03-19 11:09:10 +0000
commitafbef6406b00c91db1a79701d61786ba79f810b4 (patch)
tree11a274b70270bcfd654c93cbae8ac3cc3266c366 /util
parentd0bd1e71d926424142a139eb63ac148eb888a871 (diff)
downloadprosody-afbef6406b00c91db1a79701d61786ba79f810b4.tar.gz
prosody-afbef6406b00c91db1a79701d61786ba79f810b4.zip
prosodyctl: check turn: Fail with error if our own address is supplied for the ping test
Diffstat (limited to 'util')
-rw-r--r--util/prosodyctl/check.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/util/prosodyctl/check.lua b/util/prosodyctl/check.lua
index fc12caaa..e6b815f2 100644
--- a/util/prosodyctl/check.lua
+++ b/util/prosodyctl/check.lua
@@ -180,6 +180,12 @@ local function check_turn_service(turn_service, ping_service)
-- Only a hostname specified, use default STUN port
ping_host, ping_port = ping_service, 3478;
end
+
+ if ping_host == turn_service.host then
+ result.error = ("Unable to perform ping test: please supply an external STUN server address. See https://prosody.im/doc/turn#prosodyctl-check");
+ return result;
+ end
+
local ping_service_ip, err = socket.dns.toip(ping_host);
if not ping_service_ip then
result.error = "Unable to resolve ping service hostname: "..err;