Fix IP address serialization on big endian

IP addresses are stored in network byte order even on little
endian hosts
This commit is contained in:
moneromooo-monero 2019-05-17 18:03:04 +00:00
parent c1fa4a7f8c
commit bc1144e98e
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
2 changed files with 17 additions and 1 deletions

View file

@ -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};