diff --git a/llarp/net/utils.cpp b/llarp/net/utils.cpp index e5ffcae6f5..9e4a566ffa 100644 --- a/llarp/net/utils.cpp +++ b/llarp/net/utils.cpp @@ -5,10 +5,12 @@ namespace llarp namespace utils { static constexpr uint32_t add_u32(uint32_t x) { return uint32_t{x & 0xFFff} + uint32_t{x >> 16}; } - static constexpr uint32_t add_u32(ipv4 x) { return add_u32(oxenc::host_to_big(x.addr)); } + // static constexpr uint32_t add_u32(ipv4 x) { return add_u32(oxenc::host_to_big(x.addr)); } + static constexpr uint32_t add_u32(ipv4 x) { return add_u32(htonl(x.addr)); } static constexpr uint32_t sub_u32(uint32_t x) { return add_u32(~x); } - static constexpr uint32_t sub_u32(ipv4 x) { return sub_u32(oxenc::host_to_big(x.addr)); } + // static constexpr uint32_t sub_u32(ipv4 x) { return sub_u32(oxenc::host_to_big(x.addr)); } + static constexpr uint32_t sub_u32(ipv4 x) { return sub_u32(ntohl(x.addr)); } uint16_t ip_checksum(const uint8_t *buf, size_t sz) {