Do debug print when truncating DNS packets
authorTom Kistner <tom@duncanthrax.net>
Wed, 29 Apr 2009 19:58:00 +0000 (19:58 +0000)
committerTom Kistner <tom@duncanthrax.net>
Wed, 29 Apr 2009 19:58:00 +0000 (19:58 +0000)
src/src/dns.c

index 0b1d59d2006f709988fc064201657369e2874a16..c4115ec518a211450bb93d8cc8bb7487cef31882 100644 (file)
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/dns.c,v 1.17 2007/01/08 10:50:18 ph10 Exp $ */
+/* $Cambridge: exim/src/src/dns.c,v 1.17.2.1 2009/04/29 19:58:00 tom Exp $ */
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
@@ -562,7 +562,12 @@ if (running_in_test_harness)
 else
   dnsa->answerlen = res_search(CS name, C_IN, type, dnsa->answer, MAXPACKET);
 
-if (dnsa->answerlen > MAXPACKET) dnsa->answerlen = MAXPACKET;
+if (dnsa->answerlen > MAXPACKET)
+  {
+  DEBUG(D_dns) debug_printf("DNS lookup of %s (%s) resulted in overlong packet (size %d), truncating to %d.\n",
+    name, dns_text_type(type), dnsa->answerlen, MAXPACKET);
+  dnsa->answerlen = MAXPACKET;
+  }
 
 if (dnsa->answerlen < 0) switch (h_errno)
   {