From 8a195243841d5101890e3fd0cc9ad48b46fa0e7b Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Sat, 12 May 2012 00:31:48 +0100 Subject: stanza_router: Catch s2s stanzas to hosts we don't serve earlier, and close with host-unknown (thanks darkrain) --- core/stanza_router.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'core') diff --git a/core/stanza_router.lua b/core/stanza_router.lua index b4c65a10..cea38166 100644 --- a/core/stanza_router.lua +++ b/core/stanza_router.lua @@ -110,6 +110,10 @@ function core_process_stanza(origin, stanza) if not host_status or not host_status.authed then -- remote server trying to impersonate some other server? log("warn", "Received a stanza claiming to be from %s, over a stream authed for %s!", from_host, origin.from_host); return; -- FIXME what should we do here? does this work with subdomains? + elseif not hosts[to_host] then + log("warn", "Remote server %s sent us a stanza for %s, closing stream", origin.from_host, to_host); + origin:close("host-unknown"); + return; end end core_post_stanza(origin, stanza, origin.full_jid); -- cgit v1.2.3