aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/addr.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-06-09 09:51:42 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-06-09 09:51:42 +0100
commitbf2280a995cbc4286a5de245a3304251fead8c1a (patch)
treef49008de3d8c7aa94ea9048d61d230ca8337e29b /src/libutil/addr.c
parent4f0df8d95afab67fc8bbfdcf21d37226d6e4eb0e (diff)
downloadrspamd-bf2280a995cbc4286a5de245a3304251fead8c1a.tar.gz
rspamd-bf2280a995cbc4286a5de245a3304251fead8c1a.zip
[Minor] Allow braced and prefixed IPv6 addresses
Diffstat (limited to 'src/libutil/addr.c')
-rw-r--r--src/libutil/addr.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libutil/addr.c b/src/libutil/addr.c
index 4babfb1d2..30a9ce66a 100644
--- a/src/libutil/addr.c
+++ b/src/libutil/addr.c
@@ -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++;