mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-21 08:29:39 +08:00
Make getaddrinfo's behavior with NULL node parameter agree with the
Linux man page for it. This error was preventing CVS tip from accepting remote connections.
This commit is contained in:
parent
1045655a25
commit
d08007ae77
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/port/getaddrinfo.c,v 1.2 2003/04/02 00:49:28 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/port/getaddrinfo.c,v 1.3 2003/04/27 23:56:53 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -77,12 +77,14 @@ getaddrinfo(const char *node, const char *service,
|
|||||||
if (hp->h_addrtype != AF_INET)
|
if (hp->h_addrtype != AF_INET)
|
||||||
return EAI_ADDRFAMILY;
|
return EAI_ADDRFAMILY;
|
||||||
|
|
||||||
memmove(&(sin.sin_addr), hp->h_addr, hp->h_length);
|
memcpy(&(sin.sin_addr), hp->h_addr, hp->h_length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (hints->ai_flags & AI_PASSIVE)
|
if (hints->ai_flags & AI_PASSIVE)
|
||||||
|
sin.sin_addr.s_addr = htonl(INADDR_ANY);
|
||||||
|
else
|
||||||
sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
|
sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user