diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-08-07 09:07:27 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-08-07 09:07:27 +0200 |
commit | 6f75d5460b12d6f57b3671d71d889747da0074cc (patch) | |
tree | fbd83a1ac25d1c5294cdde04de78da6ca816eaf5 /omfwd.c | |
parent | 5674b8ef46ad0ec7c3c795f7981b6fd2d0b8330e (diff) | |
download | rsyslog-6f75d5460b12d6f57b3671d71d889747da0074cc.tar.gz rsyslog-6f75d5460b12d6f57b3671d71d889747da0074cc.tar.bz2 rsyslog-6f75d5460b12d6f57b3671d71d889747da0074cc.zip |
bugfix: IPv6 addresses could not be specified in forwarding actionv2.0.6
New syntax @[addr]:port introduced to enable that. Root problem was IPv6
addresses contain colons. (backport from 3.21.3)
Diffstat (limited to 'omfwd.c')
-rw-r--r-- | omfwd.c | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -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 */ |