summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2011-04-14 12:47:04 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2011-04-14 12:47:04 +0200
commite7deab65dcad38a613c749e44e36c6c795000867 (patch)
tree5316a4237d82cb05b548f4c1b39580f81299ac9f /plugins
parent4195f9cb08cddaeae37dc88c5e879d84391b4359 (diff)
downloadrsyslog-e7deab65dcad38a613c749e44e36c6c795000867.tar.gz
rsyslog-e7deab65dcad38a613c749e44e36c6c795000867.tar.xz
rsyslog-e7deab65dcad38a613c749e44e36c6c795000867.zip
bugfix: IPv6-address could not be specified in omrelp
this was due to improper parsing of ":" closes: http://bugzilla.adiscon.com/show_bug.cgi?id=250
Diffstat (limited to 'plugins')
-rw-r--r--plugins/omrelp/omrelp.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/plugins/omrelp/omrelp.c b/plugins/omrelp/omrelp.c
index d5ef8b4f..4a21627d 100644
--- a/plugins/omrelp/omrelp.c
+++ b/plugins/omrelp/omrelp.c
@@ -249,8 +249,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 */