ws2_32: Change back magic 127.12.34.56 to loopback on connect().

This commit is contained in:
Kai Blin 2008-05-28 10:24:12 +02:00 committed by Alexandre Julliard
parent 9d566032bb
commit 36d6310599
1 changed files with 13 additions and 0 deletions

View File

@ -1492,6 +1492,19 @@ int WINAPI WS_connect(SOCKET s, const struct WS_sockaddr* name, int namelen)
}
else
{
if (name->sa_family == WS_AF_INET)
{
struct sockaddr_in *in4 = (struct sockaddr_in*) &uaddr;
if (memcmp(&in4->sin_addr, &magic_loopback_addr, 4) == 0)
{
/* Trying to connect to magic replace-loopback address,
* assuming we really want to connect to localhost */
TRACE("Trying to connect to magic IP address, using "
"INADDR_LOOPBACK instead.\n");
in4->sin_addr.s_addr = htonl(WS_INADDR_LOOPBACK);
}
}
if (connect(fd, &uaddr.addr, uaddrlen) == 0)
goto connect_success;
}