ph10 2005/01/12 12:17:42 GMT
Modified files:
exim-doc/doc-txt ChangeLog
exim-src/src host.c
Log:
host_aton() was not handling scoped IPv6 addresses correctly.
Revision Changes Path
1.66 +3 -0 exim/exim-doc/doc-txt/ChangeLog
1.7 +8 -7 exim/exim-src/src/host.c
Index: ChangeLog
===================================================================
RCS file: /home/cvs/exim/exim-doc/doc-txt/ChangeLog,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -r1.65 -r1.66
--- ChangeLog 11 Jan 2005 15:51:02 -0000 1.65
+++ ChangeLog 12 Jan 2005 12:17:41 -0000 1.66
@@ -1,4 +1,4 @@
-$Cambridge: exim/exim-doc/doc-txt/ChangeLog,v 1.65 2005/01/11 15:51:02 ph10 Exp $
+$Cambridge: exim/exim-doc/doc-txt/ChangeLog,v 1.66 2005/01/12 12:17:41 ph10 Exp $
Change log file for Exim from version 4.21
-------------------------------------------
@@ -296,6 +296,9 @@
address", "IPv4 address", and "IPv6 address", respectively. Some calls of
the function were treating the return as a boolean value, which happened to
work because 0=false and not-0=true, but is not correct code.
+
+68. The host_aton() function was not handling scoped IPv6 addresses (those
+ with, for example, "%eth0" on the end) correctly.
Exim version 4.43
Index: host.c
===================================================================
RCS file: /home/cvs/exim/exim-src/src/host.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- host.c 11 Jan 2005 15:51:02 -0000 1.6
+++ host.c 12 Jan 2005 12:17:41 -0000 1.7
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/exim-src/src/host.c,v 1.6 2005/01/11 15:51:02 ph10 Exp $ */
+/* $Cambridge: exim/exim-src/src/host.c,v 1.7 2005/01/12 12:17:41 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -735,9 +735,10 @@
int x[4];
int v4offset = 0;
-/* Handle IPv6 address, which may end with an IPv4 address. This code is NOT
-enclosed in #if HAVE_IPV6 in order that IPv6 addresses are recognized even if
-IPv6 is not supported. */
+/* Handle IPv6 address, which may end with an IPv4 address. It may also end
+with a "scope", introduced by a percent sign. This code is NOT enclosed in #if
+HAVE_IPV6 in order that IPv6 addresses are recognized even if IPv6 is not
+supported. */
if (Ustrchr(address, ':') != NULL)
{
@@ -751,17 +752,17 @@
/* If the address starts with a colon, it will start with two colons.
Just lose the first one, which will leave a null first component. */
-
+
if (*p == ':') p++;
/* Split the address into components separated by colons. The input address
is supposed to be checked for syntax. There was a case where this was
overlooked; to guard against that happening again, check here and crash if
- there is a violation. */
+ there are too many components. */
- while (*p != 0)
+ while (*p != 0 && *p != '%')
{
- int len = Ustrcspn(p, ":");
+ int len = Ustrcspn(p, ":%");
if (len == 0) nulloffset = ci;
if (ci > 7) log_write(0, LOG_MAIN|LOG_PANIC_DIE,
"Internal error: invalid IPv6 address \"%s\" passed to host_aton()",