Summary: | syslogd: -b doesn't work with IPv6 literal addresses after ^/head@r309933 | ||
---|---|---|---|
Product: | Base System | Reporter: | Enji Cooper <ngie> |
Component: | bin | Assignee: | Hiroki Sato <hrs> |
Status: | Closed FIXED | ||
Severity: | Affects Some People | CC: | ae, hrs, linimon |
Priority: | --- | Keywords: | regression |
Version: | CURRENT | ||
Hardware: | Any | ||
OS: | Any | ||
URL: | https://reviews.freebsd.org/D10064 |
Description
Enji Cooper
2017-03-20 06:42:38 UTC
I think the following patch should fix this: Index: syslogd.c =================================================================== --- syslogd.c (revision 315478) +++ syslogd.c (working copy) @@ -477,7 +477,8 @@ main(int argc, char *argv[]) break; case 'b': bflag = 1; - if ((p = strchr(optarg, ':')) == NULL) { + if ((p = strchr(optarg, ':')) == NULL || + strchr(p + 1, ':') != NULL) { /* A hostname or filename only. */ addpeer(&(struct peer){ .pe_name = optarg, (In reply to Andrey V. Elsukov from comment #1) I'm confirming that this works for the testcases that I have: syslogd_flags="-b :syslog -b ::1 -b [::1]:syslog -b 127.0.0.1:syslog -b localhost -b localhost:syslog -d" A commit references this bug: Author: hrs Date: Mon Mar 20 17:46:33 UTC 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 Changes: head/usr.sbin/syslogd/syslogd.c (In reply to commit-hook from comment #3) Sorry for the breakage. I fixed it just now. Over to committer for possible MFC before 11.1. This issue isn't present on ^/stable/11. Closing |