aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2020-11-05 19:09:43 -0600
committerluigi1111 <luigi1111w@gmail.com>2020-11-05 19:09:43 -0600
commit33dc825d6f51300ae208a46290a25ec21e708545 (patch)
tree30bb55f0ed6b4d6b493d21916a561a096a129ace
parentMerge pull request #6981 (diff)
parentp2p: fix endianness when checking IPv6 addresses mapping to IPv4 (diff)
downloadmonero-33dc825d6f51300ae208a46290a25ec21e708545.tar.xz
Merge pull request #6983
35186b1 p2p: fix endianness when checking IPv6 addresses mapping to IPv4 (moneromooo-monero)
-rw-r--r--src/p2p/net_node.inl8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl
index 725e2a22d..acd956487 100644
--- a/src/p2p/net_node.inl
+++ b/src/p2p/net_node.inl
@@ -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();