summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhilip Hazel <ph10@hermes.cam.ac.uk>2006-03-17 16:51:45 +0000
committerPhilip Hazel <ph10@hermes.cam.ac.uk>2006-03-17 16:51:45 +0000
commitf3d7df6c6b103bd096bfc455e88d79c8f6c3195b (patch)
treed30c44e4a5498b4e1c966c1f038dd9ec4fe9307c /src
parentd114ec46542ba09900db6dd2005adaecb7a8198d (diff)
Fix address sorting untidiness for the test suite.
Diffstat (limited to 'src')
-rw-r--r--src/src/host.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/src/host.c b/src/src/host.c
index 07d28395e..01191f454 100644
--- a/src/src/host.c
+++ b/src/src/host.c
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/host.c,v 1.22 2006/02/16 10:05:33 ph10 Exp $ */
+/* $Cambridge: exim/src/src/host.c,v 1.23 2006/03/17 16:51:45 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -2876,17 +2876,19 @@ single MX preference value, IPv6 addresses come first. This can separate the
addresses of a multihomed host, but that should not matter. */
#if HAVE_IPV6
-if (h != last)
+if (h != last && !disable_ipv6)
{
for (h = host; h != last; h = h->next)
{
host_item temp;
host_item *next = h->next;
- if (h->mx != next->mx || /* If next is different MX value */
- (h->sort_key % 1000) < 500 || /* OR this one is IPv6 */
- (next->sort_key % 1000) >= 500) /* OR next is IPv4 */
- continue; /* move on to next */
- temp = *h;
+ if (h->mx != next->mx || /* If next is different MX */
+ h->address == NULL || /* OR this one is unset */
+ Ustrchr(h->address, ':') != NULL || /* OR this one is IPv6 */
+ (next->address != NULL &&
+ Ustrchr(next->address, ':') == NULL)) /* OR next is IPv4 */
+ continue; /* move on to next */
+ temp = *h; /* otherwise, swap */
temp.next = next->next;
*h = *next;
h->next = next;