summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-08-07 09:07:27 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2008-08-07 09:07:27 +0200
commit6f75d5460b12d6f57b3671d71d889747da0074cc (patch)
treefbd83a1ac25d1c5294cdde04de78da6ca816eaf5
parent5674b8ef46ad0ec7c3c795f7981b6fd2d0b8330e (diff)
downloadrsyslog-6f75d5460b12d6f57b3671d71d889747da0074cc.tar.gz
rsyslog-6f75d5460b12d6f57b3671d71d889747da0074cc.tar.xz
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)
-rw-r--r--ChangeLog5
-rw-r--r--doc/manual.html2
-rw-r--r--doc/rsyslog_conf.html9
-rw-r--r--omfwd.c14
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 <a href="professional_support.html">professional rsyslog support</a> available directly from the source!</p>
-<p><b>This documentation is for version 2.0.5 of rsyslog.</b>
+<p><b>This documentation is for version 2.0.6 of rsyslog.</b>
Visit the <i> <a href="http://www.rsyslog.com/doc-status.html">rsyslog status page</a></i></b> to obtain current
version information and project status.</p>
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.</p>
<p>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.</p>
+<p>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.
+<p>A valid sample to send messages to the IPv6 host 2001::1 at port 515
+is as follows:
+<p>*.* @[2001::1]:515
+<p>This works with TCP, too.
<p><b>Note to sysklogd users:</b> sysklogd does <b>not</b> 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 */