Fix check addr endianness in a4toa6 function

This commit is contained in:
Stephen Seo 2020-04-27 11:47:50 +09:00
parent 31ca4ddc44
commit 445a221a5b
2 changed files with 2 additions and 2 deletions

View file

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

View file

@ -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");