aboutsummaryrefslogtreecommitdiff
path: root/src/net/parse.h
diff options
context:
space:
mode:
authorJeffrey Ryan <jeffreyryan@tutanota.com>2022-11-16 15:53:15 -0600
committerJeffrey Ryan <jeffreyryan@tutanota.com>2022-11-17 18:57:04 -0600
commit38d4811c890997f20f4a3eea1b429e18bbfb4024 (patch)
treedcc2cc83c9359ff2ad7638dd34137bbbeab5344a /src/net/parse.h
parentMerge pull request #8594 (diff)
downloadmonero-38d4811c890997f20f4a3eea1b429e18bbfb4024.tar.xz
p2p: fix exclusive node DNS resolution for certain hosts [release]
Fixes #8633. The function `append_net_address` did not parse hostname + port addresses (e.g. `bar:29080`) correctly if the hostname did not contain a `'.'` character. @vtnerd comments 1 clear up 2nd conditional statement
Diffstat (limited to 'src/net/parse.h')
-rw-r--r--src/net/parse.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/net/parse.h b/src/net/parse.h
index 648076d7b..6ece931c6 100644
--- a/src/net/parse.h
+++ b/src/net/parse.h
@@ -38,6 +38,16 @@
namespace net
{
+ /*!
+ * \brief Takes a valid address string (IP, Tor, I2P, or DNS name) and splits it into host and port
+ *
+ * The host of an IPv6 addresses in the format "[x:x:..:x]:port" will have the braces stripped.
+ * For example, when the address is "[ffff::2023]", host will be set to "ffff::2023".
+ *
+ * \param address The address string one wants to split
+ * \param[out] host The host part of the address string. Is always set.
+ * \param[out] port The port part of the address string. Is only set when address string contains a port.
+ */
void get_network_address_host_and_port(const std::string& address, std::string& host, std::string& port);
/*!