aboutsummaryrefslogtreecommitdiffstats
path: root/core/stanza_router.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2012-05-12 00:31:48 +0100
committerMatthew Wild <mwild1@gmail.com>2012-05-12 00:31:48 +0100
commit56403793d7458cb2e374be3b63eb2640d587b9b9 (patch)
tree27d57167732ad830920c35f99e67ab9d86c361a0 /core/stanza_router.lua
parent9aedce9a31ac0be3e5a4772f18fa9647d711b8a2 (diff)
downloadprosody-56403793d7458cb2e374be3b63eb2640d587b9b9.tar.gz
prosody-56403793d7458cb2e374be3b63eb2640d587b9b9.zip
stanza_router: Catch s2s stanzas to hosts we don't serve earlier, and close with host-unknown (thanks darkrain)
Diffstat (limited to 'core/stanza_router.lua')
-rw-r--r--core/stanza_router.lua4
1 files changed, 4 insertions, 0 deletions
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);