Re: [Exim] [grin: ipv6 strikes again - exim rbl]

Top Page
Delete this message
Reply to this message
Author: Philip Blundell
Date:  
To: grin, exim
Subject: Re: [Exim] [grin: ipv6 strikes again - exim rbl]
I wrote:

>Sigh, I think you are right. This patch is untested but I think it's along
>roughly the right lines. Let me know if it helps any.


Doh -- pasted in the wrong bit of the patch. Let's try that again. Sorry.

p.

--- exim-3.02/src/host.c    Wed Jun  2 09:31:53 1999
+++ exim-3.02/src/host.c    Fri Jul 23 14:37:55 1999
@@ -1794,17 +1800,32 @@
 else
   {
   int i, j;
-  for (j = 3; j >= 0; j--)
+  if (IN6_IS_ADDR_V4MAPPED(bin))
     {
-    int x = bin[j];
-    for (i = 0; i < 8; i++)
+    /* Handle IPv6-mapped IPv4 addresses. */
+    int x = bin[3];
+    for (i = 0; i < 4; i++)
       {
-      sprintf(t, "%x.", x & 15);
+      sprintf(t, "%d.", x & 255);
       while (*t) t++;
-      x >>= 4;
+      x >>= 8;
+      }
+    type = T_A;
+    }
+  else
+    {
+    for (j = 3; j >= 0; j--)
+      {
+      int x = bin[j];
+      for (i = 0; i < 8; i++)
+        {
+        sprintf(t, "%x.", x & 15);
+        while (*t) t++;
+        x >>= 4;
+        }
       }
+    type = T_AAAA;
     }
-  type = T_AAAA;
   }
 #endif