Little-endian IPv4 addresses
What
Monero encodes IPv4 addresses in little-endian byte order.
Expected
In general, networking-related protocols/code use networking order (big-endian).
Why
TODO
- https://github.com/monero-project/monero/issues/3826
- https://github.com/monero-project/monero/pull/5544
Affects
Any representation and (de)serialization of IPv4 addresses must keep little
endian in-mind, e.g. the P2P wire format or int
encoded IPv4 addresses in RPC.
For example, the ip
field in set_bans
.
For Cuprate, this means Rust's Ipv4Addr::from_bits/from
cannot be used in these cases as it assumes big-endian encoding.