]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Allow braced and prefixed IPv6 addresses
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 9 Jun 2019 08:51:42 +0000 (09:51 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 9 Jun 2019 08:51:42 +0000 (09:51 +0100)
src/libutil/addr.c

index 4babfb1d2dac6094d45b29c1fa114eb724bf0850..30a9ce66a3c21d94a207707ce79c09aa7323b605 100644 (file)
@@ -527,6 +527,12 @@ rspamd_parse_inet_address_ip6 (const guchar *text, gsize len, gpointer target)
                len -= sizeof ("IPv6:") - 1;
        }
 
+       if (*p == '[' && len > 1 && p[len - 1] == ']') {
+               /* Strip [] as well */
+               p ++;
+               len -= 2;
+       }
+
        /* Ignore leading colon */
        if (len > 0 && *p == ':') {
                p++;