* klist.c (one_addr): Always use indicated address family and length in
authorKen Raeburn <raeburn@mit.edu>
Tue, 2 Nov 1999 15:38:18 +0000 (15:38 +0000)
committerKen Raeburn <raeburn@mit.edu>
Tue, 2 Nov 1999 15:38:18 +0000 (15:38 +0000)
gethostbyaddr or getipnodebyaddr calls.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11898 dc483132-0cff-0310-8789-dd5450dbe970

src/clients/klist/ChangeLog
src/clients/klist/klist.c

index 7253e97e8e8f892b911c816fdcf0315728baf554..6c4c6e5d184211448bb1279cc77e451578b7b219 100644 (file)
@@ -1,3 +1,8 @@
+1999-11-02  Ken Raeburn  <raeburn@raeburn.org>
+
+       * klist.c (one_addr): Always use indicated address family and
+       length in gethostbyaddr or getipnodebyaddr calls.
+
 1999-10-26  Tom Yu  <tlyu@mit.edu>
 
        * Makefile.in: Clean up usage of CFLAGS, CPPFLAGS, DEFS, DEFINES,
index 56bd535df66eb707e1bfda4ca310c87a8988a876..3da8ee7437c4e80bfa1a5e12a0bef47794174d4c 100644 (file)
@@ -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);
            }