Copyright year updates (things touched in 2015)
[exim.git] / src / src / dns.c
index 79c4ed3fca701eb234989a7865944d9256084065..f1c038834ee03e216c85788b17bb4e3638b8fe21 100644 (file)
@@ -2,7 +2,7 @@
 *     Exim - an Internet mail transport agent    *
 *************************************************/
 
-/* Copyright (c) University of Cambridge 1995 - 2014 */
+/* Copyright (c) University of Cambridge 1995 - 2015 */
 /* See the file NOTICE for conditions of use and distribution. */
 
 /* Functions for interfacing with the DNS. */
@@ -53,32 +53,6 @@ Ustrncpy(name, domain, len);
 name[len] = 0;
 endname = name + len;
 
-/* This code, for forcing TRY_AGAIN and NO_RECOVERY, is here so that it works
-for the old test suite that uses a real nameserver. When the old test suite is
-eventually abandoned, this code could be moved into the fakens utility. */
-
-if (len >= 14 && Ustrcmp(endname - 14, "test.again.dns") == 0)
-  {
-  int delay = Uatoi(name);  /* digits at the start of the name */
-  DEBUG(D_dns) debug_printf("Return from DNS lookup of %s (%s) faked for testing\n",
-    name, dns_text_type(type));
-  if (delay > 0)
-    {
-    DEBUG(D_dns) debug_printf("delaying %d seconds\n", delay);
-    sleep(delay);
-    }
-  h_errno = TRY_AGAIN;
-  return -1;
-  }
-
-if (len >= 13 && Ustrcmp(endname - 13, "test.fail.dns") == 0)
-  {
-  DEBUG(D_dns) debug_printf("Return from DNS lookup of %s (%s) faked for testing\n",
-    name, dns_text_type(type));
-  h_errno = NO_RECOVERY;
-  return -1;
-  }
-
 /* Look for the fakens utility, and if it exists, call it. */
 
 (void)string_format(utilname, sizeof(utilname), "%s/bin/fakens",
@@ -137,7 +111,7 @@ if (stat(CS utilname, &statbuf) >= 0)
   }
 else
   {
-    DEBUG(D_dns) debug_printf("fakens (%s) not found\n", utilname);
+  DEBUG(D_dns) debug_printf("fakens (%s) not found\n", utilname);
   }
 
 /* fakens utility not found, or it returned "pass on" */
@@ -462,6 +436,17 @@ HEADER * h = (HEADER *)dnsa->answer;
 h->ad = 0;
 }
 
+/************************************************
+ *     Check whether the AA bit is set         *
+ *     We need this to warn if we requested AD *
+ *     from a authoritive server               *
+ ************************************************/
+
+BOOL
+dns_is_aa(const dns_answer *dnsa)
+{
+return ((HEADER*)dnsa->answer)->aa;
+}