mirror of
https://github.com/monero-project/monero.git
synced 2024-12-23 20:19:34 +00:00
p2p: fix endianness when checking IPv6 addresses mapping to IPv4
This commit is contained in:
parent
bddd5653e1
commit
35186b1b84
1 changed files with 3 additions and 5 deletions
|
@ -1501,11 +1501,9 @@ namespace nodetool
|
|||
if (actual_ip.is_v4_mapped())
|
||||
{
|
||||
boost::asio::ip::address_v4 v4ip = make_address_v4_from_v6(actual_ip);
|
||||
#if BOOST_VERSION >= 106600
|
||||
return epee::net_utils::ipv4_network_address(v4ip.to_uint(), 0).host_str();
|
||||
#else
|
||||
return epee::net_utils::ipv4_network_address(v4ip.to_ulong(), 0).host_str();
|
||||
#endif
|
||||
uint32_t actual_ipv4;
|
||||
memcpy(&actual_ipv4, v4ip.to_bytes().data(), sizeof(actual_ipv4));
|
||||
return epee::net_utils::ipv4_network_address(actual_ipv4, 0).host_str();
|
||||
}
|
||||
}
|
||||
return address.host_str();
|
||||
|
|
Loading…
Reference in a new issue