From: Vsevolod Stakhov Date: Fri, 24 Jan 2020 18:22:48 +0000 (+0000) Subject: [Minor] More masks changes X-Git-Tag: 2.3~51 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=05644814583e45c0decf281f5450ef46bc6cd4d7;p=rspamd.git [Minor] More masks changes --- diff --git a/src/libutil/radix.c b/src/libutil/radix.c index 81f929731..8619d3118 100644 --- a/src/libutil/radix.c +++ b/src/libutil/radix.c @@ -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){