* klist.c (one_addr): Pass UNIX address family, not Kerberos address type, to
authorKen Raeburn <raeburn@mit.edu>
Thu, 19 Jul 2001 14:03:13 +0000 (14:03 +0000)
committerKen Raeburn <raeburn@mit.edu>
Thu, 19 Jul 2001 14:03:13 +0000 (14:03 +0000)
inet_ntop.  Print different messages for unknown address types and known
address types we don't know how to print (e.g., AF_INET6 without inet_ntop).

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

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

index eb29aad85298fc44fca411a803a0e2f9e330ee82..03608a2ab07554dc1948c880eae1b08b8f76ce22 100644 (file)
@@ -1,3 +1,10 @@
+2001-07-19  Ken Raeburn  <raeburn@mit.edu>
+
+       * klist.c (one_addr): Pass UNIX address family, not Kerberos
+       address type, to inet_ntop.  Print different messages for unknown
+       address types and known address types we don't know how to print
+       (e.g., AF_INET6 without inet_ntop).
+
 2001-06-08  Ezra Peisach  <epeisach@mit.edu>
 
        * klist.c: Include unistd.h (if present) for getopt() prototype. 
index 7d95feb63f6c1f137456b4895c5a0f7de45224f8..9bae5dda30ae9411de566993619b6df151c00cfa 100644 (file)
@@ -652,7 +652,7 @@ show_credential(cred)
 void one_addr(a)
     krb5_address *a;
 {
-    struct hostent *h;
+    struct hostent *h = 0;
 
     if ((a->addrtype == ADDRTYPE_INET && a->length == 4)
 #ifdef AF_INET6
@@ -674,7 +674,7 @@ void one_addr(a)
        if (no_resolve || !h) {
 #ifdef HAVE_INET_NTOP
            char buf[46];
-           const char *name = inet_ntop(a->addrtype, a->contents, buf, sizeof(buf));
+           const char *name = inet_ntop(af, a->contents, buf, sizeof(buf));
            if (name) {
                printf ("%s", name);
                return;
@@ -686,6 +686,8 @@ void one_addr(a)
                return;
            }
 #endif
+           printf("unprintable address (type %d)", a->addrtype);
+           return;
        }
     }
     printf("unknown addr type %d", a->addrtype);