Skip to content

Commit d08007a

Browse files
committed
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.
1 parent 1045655 commit d08007a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/port/getaddrinfo.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/port/getaddrinfo.c,v 1.2 2003/04/02 00:49:28 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/port/getaddrinfo.c,v 1.3 2003/04/27 23:56:53 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -77,12 +77,14 @@ getaddrinfo(const char *node, const char *service,
7777
if (hp->h_addrtype != AF_INET)
7878
return EAI_ADDRFAMILY;
7979

80-
memmove(&(sin.sin_addr), hp->h_addr, hp->h_length);
80+
memcpy(&(sin.sin_addr), hp->h_addr, hp->h_length);
8181
}
8282
}
8383
else
8484
{
8585
if (hints->ai_flags & AI_PASSIVE)
86+
sin.sin_addr.s_addr = htonl(INADDR_ANY);
87+
else
8688
sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
8789
}
8890

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy