+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,
|| (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);
}