From d08007ae773bc3cba62a6d3501f3078e37097d93 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 27 Apr 2003 23:56:53 +0000 Subject: [PATCH] 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. --- src/port/getaddrinfo.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/port/getaddrinfo.c b/src/port/getaddrinfo.c index 972f6b6b39..438f578f16 100644 --- a/src/port/getaddrinfo.c +++ b/src/port/getaddrinfo.c @@ -8,7 +8,7 @@ * * * 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) return EAI_ADDRFAMILY; - memmove(&(sin.sin_addr), hp->h_addr, hp->h_length); + memcpy(&(sin.sin_addr), hp->h_addr, hp->h_length); } } else { if (hints->ai_flags & AI_PASSIVE) + sin.sin_addr.s_addr = htonl(INADDR_ANY); + else sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK); }