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

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