aboutsummaryrefslogtreecommitdiff
path: root/src/p2p/net_peerlist_boost_serialization.h
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-05-17 18:03:04 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-09-04 14:54:01 +0000
commitbc1144e98e3f3f9332024c09105b7775af285966 (patch)
treee98d53798608941bd357ee924df7335d30741304 /src/p2p/net_peerlist_boost_serialization.h
parentboost: fix little/big endian compatibility (diff)
downloadmonero-bc1144e98e3f3f9332024c09105b7775af285966.tar.xz
Fix IP address serialization on big endian
IP addresses are stored in network byte order even on little endian hosts
Diffstat (limited to 'src/p2p/net_peerlist_boost_serialization.h')
-rw-r--r--src/p2p/net_peerlist_boost_serialization.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/p2p/net_peerlist_boost_serialization.h b/src/p2p/net_peerlist_boost_serialization.h
index 05eb36e65..c2773981c 100644
--- a/src/p2p/net_peerlist_boost_serialization.h
+++ b/src/p2p/net_peerlist_boost_serialization.h
@@ -95,7 +95,9 @@ namespace boost
{
uint32_t ip{na.ip()};
uint16_t port{na.port()};
+ ip = SWAP32LE(ip);
a & ip;
+ ip = SWAP32LE(ip);
a & port;
if (!typename Archive::is_saving())
na = epee::net_utils::ipv4_network_address{ip, port};