about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-09-05 07:19:46 +0000
committerUlrich Drepper <drepper@redhat.com>2004-09-05 07:19:46 +0000
commit418dfb124c2091489f8951bf2c6884a855df7198 (patch)
treeb2d116e2b6e1b534e1e08d5ab4271e45b75d461c
parent03e157d8498ec5bc064de89fad3d98c4c25157a7 (diff)
downloadglibc-418dfb124c2091489f8951bf2c6884a855df7198.tar.gz
glibc-418dfb124c2091489f8951bf2c6884a855df7198.tar.xz
glibc-418dfb124c2091489f8951bf2c6884a855df7198.zip
Update.
2004-09-05  Ulrich Drepper  <drepper@redhat.com>

	* nscd/cache.c (cache_add): Correctly log GETHOSTBYADDR and
	GETHOSTBYADDRv6 requests.
-rw-r--r--ChangeLog5
-rw-r--r--nscd/cache.c16
2 files changed, 18 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index de225ea04e..084f3cd039 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-09-05  Ulrich Drepper  <drepper@redhat.com>
+
+	* nscd/cache.c (cache_add): Correctly log GETHOSTBYADDR and
+	GETHOSTBYADDRv6 requests.
+
 2004-09-04  Ulrich Drepper  <drepper@redhat.com>
 
 	* nscd/pwdcache.c (cache_addpw): Use correct key length in
diff --git a/nscd/cache.c b/nscd/cache.c
index 2d50d7794c..69c2efb4de 100644
--- a/nscd/cache.c
+++ b/nscd/cache.c
@@ -115,9 +115,19 @@ cache_add (int type, const void *key, size_t len, struct datahead *packet,
 	   uid_t owner)
 {
   if (__builtin_expect (debug_level >= 2, 0))
-    dbg_log (_("add new entry \"%s\" of type %s for %s to cache%s"),
-	     (const char *) key, serv2str[type], dbnames[table - dbs],
-	     first ? " (first)" : "");
+    {
+      const char *str;
+      char buf[INET6_ADDRSTRLEN + 1];
+      if (type == GETHOSTBYADDR || type == GETHOSTBYADDRv6)
+	str = inet_ntop (type == GETHOSTBYADDR ? AF_INET : AF_INET6,
+			 key, buf, sizeof (buf));
+      else
+	str = key;
+
+      dbg_log (_("add new entry \"%s\" of type %s for %s to cache%s"),
+	       str, serv2str[type], dbnames[table - dbs],
+	       first ? " (first)" : "");
+    }
 
   unsigned long int hash = __nis_hash (key, len) % table->head->module;
   struct hashentry *newp;