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.
Этот коммит содержится в:
родитель
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;
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user