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

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