From f3012547437644c0c9b97c0a426dcf45948727ec Mon Sep 17 00:00:00 2001 From: Mario Klebsch Date: Thu, 4 May 2023 15:21:58 +0200 Subject: [PATCH] Added regular expression for IPv6 scope identifier to re for IPv6 address. --- src/conf.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/conf.c b/src/conf.c index 5093453..2c68548 100644 --- a/src/conf.c +++ b/src/conf.c @@ -66,9 +66,10 @@ #define PASSWORD "([^@]*)" #define IP "((([0-9]{1,3})\\.){3}[0-9]{1,3})" #define IPMASK "(" IP "(/" DIGIT "+)?)" +#define IPV6_SCOPE "((%[^ \\t\\/]{1,16})?)" #define IPV6 "(" \ - "(([0-9a-f:]{2,39}))|" \ - "(([0-9a-f:]{0,29}:" IP "))" \ + "([0-9a-f:]{2,39})" IPV6_SCOPE "|" \ + "([0-9a-f:]{0,29}:" IP ")" IPV6_SCOPE \ ")" #define IPV6MASK "(" IPV6 "(/" DIGIT "+)?)" @@ -1120,7 +1121,7 @@ static HANDLE_FUNC (handle_upstream) ip = get_string_arg (line, &match[mi]); if (!ip) return -1; - mi += 14; + mi += 16; port = (int) get_long_arg (line, &match[mi]); mi += 3;