]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] More masks changes
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 24 Jan 2020 18:22:48 +0000 (18:22 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 24 Jan 2020 18:22:48 +0000 (18:22 +0000)
src/libutil/radix.c

index 81f929731c19391702dd092a5f54e8e9eb765135..8619d3118f4d2f6b1465f03802a3eb38e86fb701 100644 (file)
@@ -299,10 +299,12 @@ rspamd_radix_add_iplist (const gchar *list, const gchar *separators,
                                                                memcpy (addr_buf.buf + 12,
                                                                                &sin->sin_addr, 4);
 
+                                                               k += 96;
+
                                                                radix_insert_compressed (tree,
                                                                                addr_buf.buf,
                                                                                sizeof (addr_buf.buf),
-                                                                               32 - k, (uintptr_t)value);
+                                                                               128 - k, (uintptr_t)value);
                                                                res ++;
                                                        }
                                                        else if (cur_ai->ai_family == AF_INET6) {
@@ -352,8 +354,9 @@ rspamd_radix_add_iplist (const gchar *list, const gchar *separators,
                        memset (addr_buf.buf, 0, 10);
                        addr_buf.buf[10] = 0xffu;
                        addr_buf.buf[11] = 0xffu;
+                       k += 96;
                        radix_insert_compressed (tree, addr_buf.buf, sizeof (addr_buf.buf),
-                                       32 - k, (uintptr_t)value);
+                                       128 - k, (uintptr_t)value);
                        res ++;
                }
                else if (af == AF_INET6){