Update version number and copyright year.
[exim.git] / src / src / routers / ipliteral.c
index 2b33a83cd70855fd5f9c4b997be02227b8644ea4..df41e35b2f8784ffdb40a8d62f914eb212d0abb5 100644 (file)
@@ -1,10 +1,10 @@
-/* $Cambridge: exim/src/src/routers/ipliteral.c,v 1.6 2005/12/05 14:38:18 ph10 Exp $ */
+/* $Cambridge: exim/src/src/routers/ipliteral.c,v 1.9 2007/01/08 10:50:20 ph10 Exp $ */
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
 *************************************************/
 
-/* Copyright (c) University of Cambridge 1995 - 2005 */
+/* Copyright (c) University of Cambridge 1995 - 2007 */
 /* See the file NOTICE for conditions of use and distribution. */
 
 
@@ -104,7 +104,7 @@ host_item *h;
 uschar *domain = addr->domain;
 uschar *ip;
 int len = Ustrlen(domain);
-int rc;
+int rc, ipv;
 
 addr_new = addr_new;         /* Keep picky compilers happy */
 addr_succeed = addr_succeed;
@@ -124,7 +124,8 @@ ip = domain + 1;
 if (strncmpic(ip, US"IPV6:", 5) == 0 || strncmpic(ip, US"IPV4:", 5) == 0)
   ip += 5;
 
-if (string_is_ip_address(ip, NULL) == 0)
+ipv = string_is_ip_address(ip, NULL);
+if (ipv == 0 || (disable_ipv6 && ipv == 6))
   {
   domain[len-1] = ']';
   return DECLINE;