]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix mapped v6 addresses
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 3 Feb 2017 13:35:41 +0000 (13:35 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 3 Feb 2017 13:35:41 +0000 (13:35 +0000)
src/libutil/addr.c

index 992eba9a2de364e5c3acd7591d412420f9bf1df8..fa20ff6fea473b1b3d76d2da82e0368e3cc36390 100644 (file)
@@ -582,10 +582,9 @@ rspamd_inet_address_v6_maybe_map (const struct sockaddr_in6 *sin6)
        if (memcmp ((const guint8 *)&sin6->sin6_addr, mask, sizeof (mask)) == 0) {
                p = (const guint8 *)&sin6->sin6_addr;
 
-               if ((p[11] == 0 && p[12] == 0) ||
-                               (p[11] == 0xff && p[12] == 0xff)) {
+               if ((p[10] == 0xff && p[11] == 0xff)) {
                        addr = rspamd_inet_addr_create (AF_INET);
-                       memcpy (&addr->u.in.addr.s4.sin_addr, &p[13],
+                       memcpy (&addr->u.in.addr.s4.sin_addr, &p[12],
                                        sizeof (struct in_addr));
                }
                else {