-$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.27 2004/11/12 15:03:40 ph10 Exp $
+$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.28 2004/11/12 16:54:55 ph10 Exp $
Change log file for Exim from version 4.21
-------------------------------------------
contain a local part and a domain, and therefore, for them, an empty
address still always fails if the pattern is not itself empty.
+30. Exim went into a mad DNS loop when attempting to do a callout where the
+ host was specified on an smtp transport, and looking it up yielded more
+ than one IP address.
+
Exim version 4.43
-----------------
-/* $Cambridge: exim/src/src/host.c,v 1.1 2004/10/07 10:39:01 ph10 Exp $ */
+/* $Cambridge: exim/src/src/host.c,v 1.2 2004/11/12 16:54:55 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
+/*************************************************
+* Sort addresses when testing *
+*************************************************/
+
+/* This function is called only when running in the test harness. It sorts a
+number of multihomed host IP addresses into the order, so as to get
+repeatability. This doesn't have to be efficient. But don't interchange IPv4
+and IPv6 addresses!
+
+Arguments:
+ host -> the first host item
+ last -> the last host item
+
+Returns: nothing
+*/
+
+static void
+sort_addresses(host_item *host, host_item *last)
+{
+BOOL done = FALSE;
+while (!done)
+ {
+ host_item *h;
+ done = TRUE;
+ for (h = host; h != last; h = h->next)
+ {
+ if ((Ustrchr(h->address, ':') == NULL) !=
+ (Ustrchr(h->next->address, ':') == NULL))
+ continue;
+ if (Ustrcmp(h->address, h->next->address) > 0)
+ {
+ uschar *temp = h->address;
+ h->address = h->next->address;
+ h->next->address = temp;
+ done = FALSE;
+ }
+ }
+ }
+}
+
+
+
/*************************************************
* Build chain of host items from list *
*************************************************/
host_scan_for_local_hosts(host, &last, NULL) : HOST_FOUND;
/* When running in the test harness, sort into the order of addresses so as to
-get repeatability. This doesn't have to be efficient. But don't interchange
-IPv4 and IPv6 addresses! */
+get repeatability. */
-if (running_in_test_harness)
- {
- BOOL done = FALSE;
- while (!done)
- {
- host_item *h;
- done = TRUE;
- for (h = host; h != last; h = h->next)
- {
- if ((Ustrchr(h->address, ':') == NULL) !=
- (Ustrchr(h->next->address, ':') == NULL))
- continue;
- if (Ustrcmp(h->address, h->next->address) > 0)
- {
- uschar *temp = h->address;
- h->address = h->next->address;
- h->next->address = temp;
- done = FALSE;
- }
- }
- }
- }
+if (running_in_test_harness) sort_addresses(host, last);
HDEBUG(D_host_lookup)
{
fails or times out, but not if another one succeeds. (In the early
IPv6 days there are name servers that always fail on AAAA, but are happy
to give out an A record. We want to proceed with that A record.) */
-
+
if (rc != DNS_SUCCEED)
{
if (i == 0) /* Just tried for an A record, i.e. end of loop */
else
if (rc == HOST_IGNORED) rc = HOST_FIND_FAILED; /* No special action */
+ /* When running in the test harness, sort into the order of addresses so as
+ to get repeatability. */
+
+ if (running_in_test_harness) sort_addresses(host, last);
+
DEBUG(D_host_lookup)
{
host_item *h;
-/* $Cambridge: exim/src/src/verify.c,v 1.4 2004/11/11 11:40:36 ph10 Exp $ */
+/* $Cambridge: exim/src/src/verify.c,v 1.5 2004/11/12 16:54:55 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
else
{
uschar *canonical_name;
- host_item *host;
+ host_item *host, *nexthost;
host_build_hostlist(&host_list, s, tf.hosts_randomize);
/* Just ignore failures to find a host address. If we don't manage
- to find any addresses, the callout will defer. */
+ to find any addresses, the callout will defer. Note that more than
+ one address may be found for a single host, which will result in
+ additional host items being inserted into the chain. Hence we must
+ save the next host first. */
- for (host = host_list; host != NULL; host = host->next)
+ for (host = host_list; host != NULL; host = nexthost)
{
+ nexthost = host->next;
if (tf.gethostbyname || string_is_ip_address(host->name, NULL))
(void)host_find_byname(host, NULL, &canonical_name, TRUE);
else