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
+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.
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
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;
return;
}
#endif
+ printf("unprintable address (type %d)", a->addrtype);
+ return;
}
}
printf("unknown addr type %d", a->addrtype);