-/* Copyright (c) 1998 Free Software Foundation, Inc.
+/* Copyright (c) 1998, 1999 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
#include <limits.h>
#include <stdlib.h>
#include <string.h>
+#include <arpa/inet.h>
#include <rpcsvc/nis.h>
#include <sys/param.h>
#include <sys/stat.h>
struct hashentry *old = head;
if (debug_level > 0)
- dbg_log ("remove %s entry \"%s\"",
- serv2str[old->type],
- old->last
- ? old->key : old->data == (void *) -1 ? old->key : "???");
+ {
+ char buf[INET6_ADDRSTRLEN];
+ const char *str;
+
+ if ((old->type == GETHOSTBYADDR || old->type == GETHOSTBYADDRv6)
+ && (old->last || old->data == (void *) -1))
+ {
+ inet_ntop (old->type == GETHOSTBYADDR ? AF_INET : AF_INET6,
+ old->key, buf, sizeof (buf));
+ str = buf;
+ }
+ else
+ str = old->last ? old->key : (old->data == (void *) -1
+ ? old->key : "???");
+
+ dbg_log ("remove %s entry \"%s\"", serv2str[old->type], str);
+ }
/* Free the data structures. */
if (old->data == (void *) -1)