# HG changeset patch # User Matthew Wild # Date 1336779108 -3600 # Node ID d1cfdb137b034a82fa2c9d4c11a8014b3a727b04 # Parent 2ee71fa500d6a793c6a20083de2ee45611a41a9e stanza_router: Catch s2s stanzas to hosts we don't serve earlier, and close with host-unknown (thanks darkrain) diff -r 2ee71fa500d6 -r d1cfdb137b03 core/stanza_router.lua --- a/core/stanza_router.lua Fri May 11 23:20:58 2012 +0100 +++ b/core/stanza_router.lua Sat May 12 00:31:48 2012 +0100 @@ -110,6 +110,10 @@ 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);