Blob Blame History Raw
From 0da5e8979b5e5466d0f7bb836f2716cbcf1d4589 Mon Sep 17 00:00:00 2001
From: Marcelo Salhab Brogliato <msbrogli@vialink.com.br>
Date: Fri, 31 May 2013 11:49:06 +0100
Subject: [PATCH 1/1] Log forwarding table overflows.

---
 src/forward.c |    9 +++++++++
 1 file changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/forward.c b/src/forward.c
index 33a68a0..6c9f646 100644
--- a/src/forward.c
+++ b/src/forward.c
@@ -1205,8 +1205,17 @@ struct frec *get_new_frec(time_t now, int *wait)
   /* none available, calculate time 'till oldest record expires */
   if (count > daemon->ftabsize)
     {
+      static time_t last_log = 0;
+      
       if (oldest && wait)
 	*wait = oldest->time + (time_t)TIMEOUT - now;
+      
+      if ((int)difftime(now, last_log) > 5)
+	{
+	  last_log = now;
+	  my_syslog(LOG_WARNING, _("Maximum number of concurrent DNS queries reached (max: %d)"), daemon->ftabsize);
+	}
+
       return NULL;
     }
   
-- 
1.7.2.5