From 6f75d5460b12d6f57b3671d71d889747da0074cc Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 7 Aug 2008 09:07:27 +0200 Subject: bugfix: IPv6 addresses could not be specified in forwarding action New syntax @[addr]:port introduced to enable that. Root problem was IPv6 addresses contain colons. (backport from 3.21.3) --- omfwd.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'omfwd.c') diff --git a/omfwd.c b/omfwd.c index afa60307..df5db7fc 100644 --- a/omfwd.c +++ b/omfwd.c @@ -553,8 +553,18 @@ CODE_STD_STRING_REQUESTparseSelectorAct(1) /* extract the host first (we do a trick - we replace the ';' or ':' with a '\0') * now skip to port and then template name. rgerhards 2005-07-06 */ - for(q = p ; *p && *p != ';' && *p != ':' ; ++p) - /* JUST SKIP */; + if(*p == '[') { /* everything is hostname upto ']' */ + ++p; /* skip '[' */ + for(q = p ; *p && *p != ']' ; ++p) + /* JUST SKIP */; + if(*p == ']') { + *p = '\0'; /* trick to obtain hostname (later)! */ + ++p; /* eat it */ + } + } else { /* traditional view of hostname */ + for(q = p ; *p && *p != ';' && *p != ':' && *p != '#' ; ++p) + /* JUST SKIP */; + } pData->port = NULL; if(*p == ':') { /* process port */ -- cgit v1.2.3