Blame SOURCES/authd-1.4.3-ipv6-mapping.patch

f5a0df
--- authd-1.4.3/authd.c.old	2005-06-24 16:08:04.000000000 +0200
f5a0df
+++ authd-1.4.3/authd.c	2005-06-24 16:12:06.000000000 +0200
f5a0df
@@ -485,8 +485,19 @@
f5a0df
 
f5a0df
                 assert(opt.mapped != NULL);
f5a0df
                 strcpy(peer_128, opt.mapped); strcpy(host_128, opt.mapped);
f5a0df
-                strncpy(host_128, addr_hex, z);
f5a0df
-                strncpy(peer_128, peer_addr_hex, strlen(peer_addr_hex));
f5a0df
+
f5a0df
+                /*
f5a0df
+                   If mapping IPV4 to IPV6 space is enabled,
f5a0df
+                   take only last 4 numbers of IPV6
f5a0df
+                */
f5a0df
+                if(opt.mapped[0]) {
f5a0df
+                  strncpy(host_128, addr_hex+z-8, 8);
f5a0df
+                  strncpy(peer_128, peer_addr_hex, 8);
f5a0df
+                } else {
f5a0df
+                  strncpy(host_128, addr_hex, z);
f5a0df
+                  strncpy(peer_128, peer_addr_hex, strlen(peer_addr_hex));
f5a0df
+                }
f5a0df
+
f5a0df
                 if (strcmp(peer_128, host_128) != 0) return addr;
f5a0df
             }
f5a0df
             // hex addr must have even number of digits