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) --- ChangeLog | 5 ++++- doc/manual.html | 2 +- doc/rsyslog_conf.html | 9 +++++++++ omfwd.c | 14 ++++++++++++-- 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 832d078e..1db933ff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ --------------------------------------------------------------------------- -Version 2.0.6 V2-STABLE (rgerhards), 2008-??-?? +Version 2.0.6 V2-STABLE (rgerhards), 2008-08-07 +- bugfix: IPv6 addresses could not be specified in forwarding actions + New syntax @[addr]:port introduced to enable that. Root problem was IPv6 + addresses contain colons. (backport from 3.21.3) --------------------------------------------------------------------------- Version 2.0.5 STABLE (rgerhards), 2008-05-15 - bugfix: regular expressions inside property replacer did not work diff --git a/doc/manual.html b/doc/manual.html index 2e030ab5..ce874fce 100644 --- a/doc/manual.html +++ b/doc/manual.html @@ -31,7 +31,7 @@ relay chains while at the same time being very easy to setup for the novice user. And as we know what enterprise users really need, there is also professional rsyslog support available directly from the source!

-

This documentation is for version 2.0.5 of rsyslog. +

This documentation is for version 2.0.6 of rsyslog. Visit the rsyslog status page to obtain current version information and project status.

diff --git a/doc/rsyslog_conf.html b/doc/rsyslog_conf.html index bf878e82..25298d33 100644 --- a/doc/rsyslog_conf.html +++ b/doc/rsyslog_conf.html @@ -535,6 +535,15 @@ framing and maximum compression to the host 192.168.0.1 at port 1470.

In the example above, messages are forwarded via UDP to the machine 192.168.0.1, the destination port defaults to 514. Messages will not be compressed.

+

Note that IPv6 addresses contain colons. So if an IPv6 address is specified +in the hostname part, rsyslogd could not detect where the IP address ends +and where the port starts. There is a syntax extension to support this: +put squary brackets around the address (e.g. "[2001::1]"). Square +brackets also work with real host names and IPv4 addresses, too. +

A valid sample to send messages to the IPv6 host 2001::1 at port 515 +is as follows: +

*.* @[2001::1]:515 +

This works with TCP, too.

Note to sysklogd users: sysklogd does not support RFC 3164 format, which is the default forwarding template in rsyslog. As such, you will experience duplicate hostnames if rsyslog is the sender and sysklogd is the 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