]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Fix] Fix ipv6 mask application
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 3 May 2016 12:02:35 +0000 (13:02 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 3 May 2016 12:02:35 +0000 (13:02 +0100)
src/libutil/addr.c

index 255c28de46cedf885b340570702331521b6b6edf..8fc85e6c71bc160ea9c32cf30637863f020692fe 100644 (file)
@@ -1245,7 +1245,7 @@ rspamd_inet_address_apply_mask (rspamd_inet_addr_t *addr, guint mask)
                        umsk = htonl (G_MAXUINT32 << (32 - mask));
                        addr->u.in.addr.s4.sin_addr.s_addr &= umsk;
                }
-               else if (addr->af == AF_INET && mask <= 128) {
+               else if (addr->af == AF_INET6 && mask <= 128) {
                        p = (uint32_t *)&addr->u.in.addr.s6.sin6_addr;
                        p += 3;
                        while (mask > 0) {