diff --git a/src/UDPConnection.cpp b/src/UDPConnection.cpp index 0829ed2..b498088 100644 --- a/src/UDPConnection.cpp +++ b/src/UDPConnection.cpp @@ -3058,7 +3058,7 @@ UDPC_IPV6_ADDR_TYPE UDPC_a4toa6(uint32_t a4_be) { uint32_t a4 = ntohl(a4_be); - if(a4 == 0x7F000001) { + if(a4 == 0x0100007F) { return in6addr_loopback; } diff --git a/src/test/TestUDPC.cpp b/src/test/TestUDPC.cpp index e0e0f76..a8d1ddc 100644 --- a/src/test/TestUDPC.cpp +++ b/src/test/TestUDPC.cpp @@ -321,7 +321,7 @@ TEST(UDPC, NetworkOrderEndianness) { TEST(UDPC, a4toa6) { EXPECT_EQ(UDPC_a4toa6(0), in6addr_any); - uint32_t a4 = htonl(0x7F000001); + uint32_t a4 = htonl(0x0100007F); EXPECT_EQ(UDPC_a4toa6(a4), in6addr_loopback); UDPC_IPV6_ADDR_TYPE a6 = UDPC_strtoa("::FFFF:0102:0304");