From 22471e9b4c479709a3b44b6f05a8b5d27b6b7011 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sat, 28 Sep 2019 14:13:58 -0700 Subject: [PATCH] ircd: Use conf items to get this info for now. --- ircd/net.cc | 14 ++++++++++++-- ircd/server.cc | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ircd/net.cc b/ircd/net.cc index b37c45671..0a05d9b90 100644 --- a/ircd/net.cc +++ b/ircd/net.cc @@ -2091,8 +2091,18 @@ try if(!name) return true; - //TODO: XXX - if(!m::my_host(name)) + const string_view accept[] + { + ircd::server_name, + ircd::network_name, + }; + + const bool accepts + { + std::find(begin(accept), end(accept), name) != end(accept) + }; + + if(!accepts) { log::dwarning { diff --git a/ircd/server.cc b/ircd/server.cc index 4fbf231ab..6fdf3fe48 100644 --- a/ircd/server.cc +++ b/ircd/server.cc @@ -1442,7 +1442,7 @@ ircd::server::peer::open_links() try { if(unlikely(is_loop(open_opts.ipport))) - if(!my_host(net::server_name(open_opts))) + if(net::server_name(open_opts) != string_view{ircd::network_name}) throw unavailable { "Won't open loopback for remote host '%s'",