syslogd no longer accepts `-b ::1` and `-b [::1]:syslog` after the refactoring done in r309933. Example: Legacy format (`-b ::1`): $ sudo env rc_debug=1 /etc/rc.d/syslogd restart /etc/rc.d/syslogd: DEBUG: Sourcing /etc/defaults/rc.conf /etc/rc.d/syslogd: DEBUG: pid file (/var/run/syslog.pid): not readable. /etc/rc.d/syslogd: DEBUG: checkyesno: syslogd_enable is set to YES. /etc/rc.d/syslogd: DEBUG: pid file (/var/run/syslog.pid): not readable. /etc/rc.d/syslogd: DEBUG: checkyesno: syslogd_enable is set to YES. syslogd not running? (check /var/run/syslog.pid). /etc/rc.d/syslogd: DEBUG: pid file (/var/run/syslog.pid): not readable. /etc/rc.d/syslogd: DEBUG: checkyesno: syslogd_enable is set to YES. /etc/rc.d/syslogd: DEBUG: run_rc_command: start_precmd: syslogd_precmd Starting syslogd. /etc/rc.d/syslogd: DEBUG: run_rc_command: doit: limits -C daemon /usr/sbin/syslogd -b ::1 -b :syslog -b [::1]:syslog -b 127.0.0.1:syslog -d syslogd: getaddrinfo failed for :1: servname not supported for ai_socktype: Bad file descriptor logmsg: pri 53, flags 4, from , msg syslogd: getaddrinfo failed for :1: servname not supported for ai_socktype: Bad file descriptor Logging to UNUSED /etc/rc.d/syslogd: WARNING: failed to start syslogd Square bracket format with service identifier (`-b [::1]:syslog`) $ sudo env rc_debug=1 /etc/rc.d/syslogd restart /etc/rc.d/syslogd: DEBUG: Sourcing /etc/defaults/rc.conf /etc/rc.d/syslogd: DEBUG: pid file (/var/run/syslog.pid): not readable. /etc/rc.d/syslogd: DEBUG: checkyesno: syslogd_enable is set to YES. /etc/rc.d/syslogd: DEBUG: pid file (/var/run/syslog.pid): not readable. /etc/rc.d/syslogd: DEBUG: checkyesno: syslogd_enable is set to YES. syslogd not running? (check /var/run/syslog.pid). /etc/rc.d/syslogd: DEBUG: pid file (/var/run/syslog.pid): not readable. /etc/rc.d/syslogd: DEBUG: checkyesno: syslogd_enable is set to YES. /etc/rc.d/syslogd: DEBUG: run_rc_command: start_precmd: syslogd_precmd Starting syslogd. /etc/rc.d/syslogd: DEBUG: run_rc_command: doit: limits -C daemon /usr/sbin/syslogd -b :syslog -b [::1]:syslog -b 127.0.0.1:syslog -b localhost -b localhost:syslog -d new socket fd is 6 shutdown sending on socket new socket fd is 7 shutdown sending on socket Trying peer: [ syslogd: getaddrinfo failed for [:1]:syslog: servname not supported for ai_socktype: Bad file descriptor logmsg: pri 53, flags 4, from , msg syslogd: getaddrinfo failed for [:1]:syslog: servname not supported for ai_socktype: Bad file descriptor Logging to UNUSED /etc/rc.d/syslogd: WARNING: failed to start syslog Square bracket format without service identifier (`-b [::1]`) $ sudo env rc_debug=1 /etc/rc.d/syslogd restart /etc/rc.d/syslogd: DEBUG: Sourcing /etc/defaults/rc.conf /etc/rc.d/syslogd: DEBUG: pid file (/var/run/syslog.pid): not readable. /etc/rc.d/syslogd: DEBUG: checkyesno: syslogd_enable is set to YES. /etc/rc.d/syslogd: DEBUG: pid file (/var/run/syslog.pid): not readable. /etc/rc.d/syslogd: DEBUG: checkyesno: syslogd_enable is set to YES. syslogd not running? (check /var/run/syslog.pid). /etc/rc.d/syslogd: DEBUG: pid file (/var/run/syslog.pid): not readable. /etc/rc.d/syslogd: DEBUG: checkyesno: syslogd_enable is set to YES. /etc/rc.d/syslogd: DEBUG: run_rc_command: start_precmd: syslogd_precmd Starting syslogd. /etc/rc.d/syslogd: DEBUG: run_rc_command: doit: limits -C daemon /usr/sbin/syslogd -b [::1] -b :syslog -b 127.0.0.1:syslog -d Trying peer: [ syslogd: getaddrinfo failed for [:1]: servname not supported for ai_socktype: Bad file descriptor logmsg: pri 53, flags 4, from , msg syslogd: getaddrinfo failed for [:1]: servname not supported for ai_socktype: Bad file descriptor Logging to UNUSED /etc/rc.d/syslogd: WARNING: failed to start syslogd
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