X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/1705dd20918634cfce236049e47d0fe43753dbc8..3386088d5af4d4c61faa12ae29560e2c5bd43304:/src/src/dns.c diff --git a/src/src/dns.c b/src/src/dns.c index 79c4ed3fc..f1c038834 100644 --- a/src/src/dns.c +++ b/src/src/dns.c @@ -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; +}