diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-05-17 18:03:04 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-09-04 14:54:01 +0000 |
commit | bc1144e98e3f3f9332024c09105b7775af285966 (patch) | |
tree | e98d53798608941bd357ee924df7335d30741304 /src/p2p/net_peerlist_boost_serialization.h | |
parent | boost: fix little/big endian compatibility (diff) | |
download | monero-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.h | 2 |
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}; |