diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-06-09 09:51:42 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-06-09 09:51:42 +0100 |
commit | bf2280a995cbc4286a5de245a3304251fead8c1a (patch) | |
tree | f49008de3d8c7aa94ea9048d61d230ca8337e29b /src/libutil/addr.c | |
parent | 4f0df8d95afab67fc8bbfdcf21d37226d6e4eb0e (diff) | |
download | rspamd-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.c | 6 |
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++; |