From afbef6406b00c91db1a79701d61786ba79f810b4 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Sat, 19 Mar 2022 11:09:10 +0000 Subject: prosodyctl: check turn: Fail with error if our own address is supplied for the ping test --- util/prosodyctl/check.lua | 6 ++++++ 1 file changed, 6 insertions(+) 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; -- cgit v1.2.3