diff options
author | luigi1111 <luigi1111w@gmail.com> | 2023-01-11 11:39:42 -0500 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2023-01-11 11:39:42 -0500 |
commit | b363eebd52de5decb47ded0f9ddd10097b853c85 (patch) | |
tree | 8a519e4f04f941edf6c2dece0e99cf0e3a9590fe /src/p2p | |
parent | Merge pull request #8640 (diff) | |
parent | p2p: fix exclusive node DNS resolution for certain hosts (diff) | |
download | monero-b363eebd52de5decb47ded0f9ddd10097b853c85.tar.xz |
Merge pull request #8643
faaf2af p2p: fix exclusive node DNS resolution for certain hosts (Jeffrey Ryan)
Diffstat (limited to 'src/p2p')
-rw-r--r-- | src/p2p/net_node.inl | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl index f1e538f22..df67734d5 100644 --- a/src/p2p/net_node.inl +++ b/src/p2p/net_node.inl @@ -645,20 +645,10 @@ namespace nodetool { using namespace boost::asio; - std::string host = addr; + // Split addr string into host string and port string + std::string host; std::string port = std::to_string(default_port); - size_t colon_pos = addr.find_last_of(':'); - size_t dot_pos = addr.find_last_of('.'); - size_t square_brace_pos = addr.find('['); - - // IPv6 will have colons regardless. IPv6 and IPv4 address:port will have a colon but also either a . or a [ - // as IPv6 addresses specified as address:port are to be specified as "[addr:addr:...:addr]:port" - // One may also specify an IPv6 address as simply "[addr:addr:...:addr]" without the port; in that case - // the square braces will be stripped here. - if ((std::string::npos != colon_pos && std::string::npos != dot_pos) || std::string::npos != square_brace_pos) - { - net::get_network_address_host_and_port(addr, host, port); - } + net::get_network_address_host_and_port(addr, host, port); MINFO("Resolving node address: host=" << host << ", port=" << port); io_service io_srv; |