Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Mar 2017 17:46:33 +0000 (UTC)
From:      Hiroki Sato <hrs@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r315643 - head/usr.sbin/syslogd
Message-ID:  <201703201746.v2KHkXC5039070@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hrs
Date: Mon Mar 20 17:46:33 2017
New Revision: 315643
URL: https://svnweb.freebsd.org/changeset/base/315643

Log:
  Fix a regression which prevented an IPv6 address in a -b option from
  working.
  
  PR:	217939
  Differential Revision:	https://reviews.freebsd.org/D10064

Modified:
  head/usr.sbin/syslogd/syslogd.c

Modified: head/usr.sbin/syslogd/syslogd.c
==============================================================================
--- head/usr.sbin/syslogd/syslogd.c	Mon Mar 20 17:26:13 2017	(r315642)
+++ head/usr.sbin/syslogd/syslogd.c	Mon Mar 20 17:46:33 2017	(r315643)
@@ -477,7 +477,15 @@ main(int argc, char *argv[])
 			break;
 		case 'b':
 			bflag = 1;
-			if ((p = strchr(optarg, ':')) == NULL) {
+			p = strchr(optarg, ']');
+			if (p != NULL)
+				p = strchr(p + 1, ':');
+			else {
+				p = strchr(optarg, ':');
+				if (p != NULL && strchr(p + 1, ':') != NULL)
+					p = NULL; /* backward compatibility */
+			}
+			if (p == NULL) {
 				/* A hostname or filename only. */
 				addpeer(&(struct peer){
 					.pe_name = optarg,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703201746.v2KHkXC5039070>