From: Ken Raeburn Date: Tue, 2 Nov 1999 15:38:18 +0000 (+0000) Subject: * klist.c (one_addr): Always use indicated address family and length in X-Git-Tag: krb5-1.2-beta1~189 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2b806f2bd5c8fe0c97f0fe6ddc41655a3581e6f7;p=krb5.git * klist.c (one_addr): Always use indicated address family and length in gethostbyaddr or getipnodebyaddr calls. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11898 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/clients/klist/ChangeLog b/src/clients/klist/ChangeLog index 7253e97e8..6c4c6e5d1 100644 --- a/src/clients/klist/ChangeLog +++ b/src/clients/klist/ChangeLog @@ -1,3 +1,8 @@ +1999-11-02 Ken Raeburn + + * klist.c (one_addr): Always use indicated address family and + length in gethostbyaddr or getipnodebyaddr calls. + 1999-10-26 Tom Yu * Makefile.in: Clean up usage of CFLAGS, CPPFLAGS, DEFS, DEFINES, diff --git a/src/clients/klist/klist.c b/src/clients/klist/klist.c index 56bd535df..3da8ee743 100644 --- a/src/clients/klist/klist.c +++ b/src/clients/klist/klist.c @@ -551,16 +551,21 @@ void one_addr(a) || (a->addrtype == ADDRTYPE_INET6 && a->length == 16) #endif ) { + int af = AF_INET; +#ifdef AF_INET6 + if (a->addrtype == ADDRTYPE_INET6) + af = AF_INET6; +#endif if (!no_resolve) { #ifdef HAVE_GETIPNODEBYADDR int err; - h = getipnodebyaddr(a->contents, 16, AF_INET6, &err); + h = getipnodebyaddr(a->contents, a->length, af, &err); if (h) { printf("%s", h->h_name); freehostent(h); } #else - h = gethostbyaddr(a->contents, 4, AF_INET); + h = gethostbyaddr(a->contents, a->length, af); if (h) { printf("%s", h->h_name); }