1
1

Fixes for localhost check. Should really use ntohl instead of htonl, as

the data is in network byte order and we want it in host byte order so
we can modify it.  The big issue, though, is that 127 is 0x7F, not 0x74,
so there was the possibility of false positives with this test...

This commit was SVN r11919.
Этот коммит содержится в:
Brian Barrett 2006-10-01 16:59:44 +00:00
родитель 9ccbab464d
Коммит 13b25a732a

Просмотреть файл

@ -646,8 +646,9 @@ opal_ifislocalhost(struct sockaddr *addr)
case AF_INET:
{
struct sockaddr_in *inaddr = (struct sockaddr_in*) addr;
/* if it's in the 127. domain, it shouldn't be routed */
if (0x74000000 == (0x74000000 & htonl(inaddr->sin_addr.s_addr))) {
/* if it's in the 127. domain, it shouldn't be routed
(0x7f == 127) */
if (0x7F000000 == (0x7F000000 & ntohl(inaddr->sin_addr.s_addr))) {
return true;
}
return false;