From bdab0cf703ec3b0e0acefb1948c1d238524ba389 Mon Sep 17 00:00:00 2001 From: dr7ana Date: Mon, 13 Jan 2025 06:57:28 -0800 Subject: [PATCH] dropme: once oxenc constexpr is merged --- llarp/net/utils.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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) {