You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Line 603 of the is_ip_valid function in the ip.c file:
if (ipXto4(*ip) !=INADDR_LOOPBACK&&ipXto4(*ip) !=INADDR_NONE)
returnYES;
It only works on a big endian device. On a little endian device, ipXto4(*ip) of a loopback device has the value 0x100007f while INADDR_LOOPBACK has the value 0x7f000001.
Should we use something like htonl' to convert IP addresses from host order to network order before the comparison?
Also on line 592, for an IPv6 loopback address ::1, is_zero((void*) ip, sizeof ( IPX_T) - sizeof (IP4_T) always evaluates TRUE but family is AF_INET6, so the condition (family != (is_zero((void*) ip, sizeof ( IPX_T) - sizeof (IP4_T)) ? AF_INET : AF_INET6) is alway TRUE. Line 595 to 598 will always be skipped.
The text was updated successfully, but these errors were encountered:
Line 603 of the is_ip_valid function in the ip.c file:
It only works on a big endian device. On a little endian device,
ipXto4(*ip)
of a loopback device has the value0x100007f
whileINADDR_LOOPBACK
has the value0x7f000001
.Should we use something like
htonl
' to convert IP addresses from host order to network order before the comparison?Also on line 592, for an IPv6 loopback address ::1,
is_zero((void*) ip, sizeof ( IPX_T) - sizeof (IP4_T)
always evaluates TRUE but family is AF_INET6, so the condition(family != (is_zero((void*) ip, sizeof ( IPX_T) - sizeof (IP4_T)) ? AF_INET : AF_INET6)
is alway TRUE. Line 595 to 598 will always be skipped.The text was updated successfully, but these errors were encountered: