From d35f2b135f6546285860f4ce2b268f9ea842711e Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Thu, 25 Apr 2002 00:43:35 +0000 Subject: [PATCH] * fake-addrinfo.h (getaddrinfo) [_AIX]: Declare and initialize variable "ai" git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14420 dc483132-0cff-0310-8789-dd5450dbe970 --- src/include/ChangeLog | 5 +++++ src/include/fake-addrinfo.h | 14 +++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/include/ChangeLog b/src/include/ChangeLog index ad3d83cdf..56ad4e43d 100644 --- a/src/include/ChangeLog +++ b/src/include/ChangeLog @@ -1,3 +1,8 @@ +2002-04-24 Ken Raeburn + + * fake-addrinfo.h (getaddrinfo) [_AIX]: Declare and initialize + variable "ai". + 2002-04-12 Ken Raeburn * configure.in: Check for gethostbyname_r, gethostbyaddr_r, diff --git a/src/include/fake-addrinfo.h b/src/include/fake-addrinfo.h index bcfabcc6d..64eb2536d 100644 --- a/src/include/fake-addrinfo.h +++ b/src/include/fake-addrinfo.h @@ -674,6 +674,9 @@ getaddrinfo (const char *name, const char *serv, const struct addrinfo *hint, struct addrinfo **result) { int aierr; +#ifdef _AIX + struct addrinfo *ai; +#endif aierr = (*gaiptr) (name, serv, hint, result); if (aierr || *result == 0) @@ -751,26 +754,23 @@ getaddrinfo (const char *name, const char *serv, const struct addrinfo *hint, #endif #ifdef _AIX - for (; ai; ai = ai->ai_next) { + for (ai = *result; ai; ai = ai->ai_next) { /* AIX 4.3.3 libc is broken. It doesn't set the family or len fields of the sockaddr structures. */ if (ai->ai_addr->sa_family == 0) ai->ai_addr->sa_family = ai->ai_family; -#ifdef HAVE_SA_LEN /* always true on aix, actually */ +#ifdef HAVE_SA_LEN /* always true on AIX, actually */ if (ai->ai_addr->sa_len == 0) ai->ai_addr->sa_len = ai->ai_addrlen; #endif } #endif - /* Not dealt with yet: + /* Not dealt with currently: - Some versions of GNU libc can lose some IPv4 addresses in certain cases when multiple IPv4 and IPv6 addresses are - available. - - - Wrapping a possibly-missing system version, as we'll need to - do for Windows. */ + available. */ return 0; } -- 2.26.2