diff --git a/ircd/net_dns.cc b/ircd/net_dns.cc index 8b2e84e80..e253d4693 100644 --- a/ircd/net_dns.cc +++ b/ircd/net_dns.cc @@ -15,7 +15,7 @@ namespace ircd::net::dns template static rfc1035::record *new_record(mutable_buffer &, const rfc1035::answer &); static void handle_resolved(std::exception_ptr, const tag &, const answers &); - static void handle_resolve_A_ipport(const hostport &, const json::object &rr, opts, uint16_t, callback_ipport); + static void handle_resolve_A_ipport(const hostport &, const json::object &rr, opts, callback_ipport); static void handle_resolve_SRV_ipport(const hostport &, const json::object &rr, opts, callback_ipport); static void handle_resolve_one(const hostport &, const json::array &rr, callback_one); } @@ -81,7 +81,7 @@ ircd::net::dns::resolve(const hostport &hp, { net::dns::callback_one handler { - std::bind(&handle_resolve_A_ipport, ph::_1, ph::_2, opts, port(hp), std::move(callback)) + std::bind(&handle_resolve_A_ipport, ph::_1, ph::_2, opts, std::move(callback)) }; resolve(hp, opts, std::move(handler)); @@ -356,7 +356,7 @@ ircd::net::dns::handle_resolve_SRV_ipport(const hostport &hp, opts.nxdomain_exceptions = true; net::dns::callback_one handler { - std::bind(&handle_resolve_A_ipport, ph::_1, ph::_2, opts, port(target), std::move(callback)) + std::bind(&handle_resolve_A_ipport, ph::_1, ph::_2, opts, std::move(callback)) }; resolve(target, opts, std::move(handler)); @@ -366,7 +366,6 @@ void ircd::net::dns::handle_resolve_A_ipport(const hostport &hp, const json::object &rr, const opts opts, - const uint16_t port, const callback_ipport callback) { const json::string &error @@ -383,12 +382,7 @@ ircd::net::dns::handle_resolve_A_ipport(const hostport &hp, const ipport &ipport { - ip, port - }; - - const hostport &target - { - host(hp), port + ip, port(hp) }; const auto eptr @@ -400,7 +394,7 @@ ircd::net::dns::handle_resolve_A_ipport(const hostport &hp, std::exception_ptr{} }; - callback(eptr, target, ipport); + callback(eptr, hp, ipport); } /// Called back from the dns::resolver with a vector of answers to the