0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2025-01-14 00:34:18 +01:00

ircd::server: Prevent loopbacking at peer::open_links() stage.

This commit is contained in:
Jason Volk 2019-09-16 11:33:55 -07:00
parent 2115bf7cf4
commit 7c69eda4a6

View file

@ -1414,6 +1414,14 @@ void
ircd::server::peer::open_links()
try
{
if(unlikely(is_loop(open_opts.ipport)))
if(!my_host(server_name(open_opts)))
throw unavailable
{
"Won't open loopback for remote host '%s'",
server_name(open_opts),
};
// The hostname in open_opts should still reference this object's string.
assert(host(open_opts.hostport).data() == this->hostcanon.data());