mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Support ipv6 for peer and RPC comms:
Fixes: RIPD-1574 Alias beast address classes to the asio equivalents. Adjust users of address classes accordingly. Fix resolver class so that it can support ipv6 addresses. Make unit tests use ipv6 localhost network. Extend endpoint peer message to support string endpoint representations while also supporting the existing fields (both are optional/repeated types). Expand test for Livecache and Endpoint. Workaround some false positive ipaddr tests on windows (asio bug?) Replaced usage of address::from_string(deprecated) with free function make_address. Identified a remaining use of v4 address type and replaced with the more appropriate IPEndpoint type (rpc_ip cmdline option). Add CLI flag for using ipv4 with unit tests. Release Notes ------------- The optional rpc_port command line flag is deprecated. The rpc_ip parameter now works as documented and accepts ip and port combined.
This commit is contained in:
@@ -618,8 +618,15 @@ public:
|
||||
{
|
||||
Endpoint ep;
|
||||
ep.hops = 0;
|
||||
// we use the unspecified (0) address here because the value is
|
||||
// irrelevant to recipients. When peers receive an endpoint
|
||||
// with 0 hops, they use the socket remote_addr instead of the
|
||||
// value in the message. Furthermore, since the address value
|
||||
// is ignored, the type/version (ipv4 vs ipv6) doesn't matter
|
||||
// either. ipv6 has a slightly more compact string
|
||||
// representation of 0, so use that for self entries.
|
||||
ep.address = beast::IP::Endpoint (
|
||||
beast::IP::AddressV4 ()).at_port (
|
||||
beast::IP::AddressV6 ()).at_port (
|
||||
config_.listeningPort);
|
||||
for (auto& t : targets)
|
||||
t.insert (ep);
|
||||
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
{
|
||||
beast::IP::Endpoint ep (beast::IP::Endpoint::from_string (m_strings [i]));
|
||||
if (is_unspecified (ep))
|
||||
ep = beast::IP::Endpoint::from_string_altform (m_strings [i]);
|
||||
ep = beast::IP::Endpoint::from_string (m_strings [i]);
|
||||
if (! is_unspecified (ep))
|
||||
results.addresses.push_back (ep);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user