mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-27 05:13:25 +01:00
p2p: fix endianness when checking IPv6 addresses mapping to IPv4
This commit is contained in:
parent
67f2bec2df
commit
c64b94bd14
@ -1518,11 +1518,9 @@ namespace nodetool
|
|||||||
if (actual_ip.is_v4_mapped())
|
if (actual_ip.is_v4_mapped())
|
||||||
{
|
{
|
||||||
boost::asio::ip::address_v4 v4ip = make_address_v4_from_v6(actual_ip);
|
boost::asio::ip::address_v4 v4ip = make_address_v4_from_v6(actual_ip);
|
||||||
#if BOOST_VERSION >= 106600
|
uint32_t actual_ipv4;
|
||||||
return epee::net_utils::ipv4_network_address(v4ip.to_uint(), 0).host_str();
|
memcpy(&actual_ipv4, v4ip.to_bytes().data(), sizeof(actual_ipv4));
|
||||||
#else
|
return epee::net_utils::ipv4_network_address(actual_ipv4, 0).host_str();
|
||||||
return epee::net_utils::ipv4_network_address(v4ip.to_ulong(), 0).host_str();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return address.host_str();
|
return address.host_str();
|
||||||
|
Loading…
Reference in New Issue
Block a user