From 3379970e46e9a7f00db2fc3ace8c7798cbe380e5 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Thu, 30 Aug 2001 19:32:23 +0000 Subject: [PATCH] * fake-addrinfo.c (getnameinfo): Cast address argument to gethostbyaddr git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13700 dc483132-0cff-0310-8789-dd5450dbe970 --- src/include/ChangeLog | 3 +++ src/include/fake-addrinfo.c | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/include/ChangeLog b/src/include/ChangeLog index db83cc52c..2e5416c32 100644 --- a/src/include/ChangeLog +++ b/src/include/ChangeLog @@ -1,5 +1,8 @@ 2001-08-30 Ken Raeburn + * fake-addrinfo.c (getnameinfo): Cast address argument to + gethostbyaddr. + * fake-addrinfo.h (AI_V4MAPPED, AI_ADDRCONFIG, AI_ALL, AI_DEFAULT): Define as bogus values, since they're part of getipnodeby* API, not getaddrinfo API. diff --git a/src/include/fake-addrinfo.c b/src/include/fake-addrinfo.c index 58fa7424b..c73ecf527 100644 --- a/src/include/fake-addrinfo.c +++ b/src/include/fake-addrinfo.c @@ -39,6 +39,13 @@ * fashion that it might be confused with the original M.I.T. software. */ +/* To do, maybe: + + IPv6 support for systems with working inet6 socket code but broken + getaddrinfo implementations? (RH Linux 6.1 libc getaddrinfo + ignores AI_NUMERICHOST. Solaris 8 doesn't appear to support + IPv6.) Could use gethostbyname2 if available. */ + #include "fake-addrinfo.h" #if !defined (HAVE_GETADDRINFO) || defined (BROKEN_GETADDRINFO) @@ -209,7 +216,7 @@ int getnameinfo (const struct sockaddr *sa, socklen_t len, else return EAI_FAIL; /* ?? */ } else { - hp = gethostbyaddr (&sinp->sin_addr, sizeof (struct in_addr), + hp = gethostbyaddr ((struct sockaddr *) &sinp->sin_addr, sizeof (struct in_addr), sa->sa_family); if (hp == 0) { if (h_errno == NO_ADDRESS && !(flags & NI_NAMEREQD)) /* ??? */ -- 2.26.2