Recently many daemons that had a long history of only being able to bind to all available IPs have been modified to accept a runtime flag to allow binding to one or more specific IPs. With the wide use of FreeBSD in environments where the host may be on multiple networks (internal, external, management, etc.) and with jails becoming more common, it's becoming necessary for any service to be able to bind to one or more specific IPs. Firewalls can of course block access for traffic entering on unwanted interfaces, but jails present an issue with binding to all available IPs - if you run the same service in a jail, that service cannot bind since the jail's host is using the IP. mountd, nfsd, rpcinfo and others have been changed to allow the administrator to specify either a single IP to bind to (-h option) or a list of IPs to bind to (multiple -h options). syslogd does have the "-b" option, but it only can be called once. If the administrator passes multiple "-b" options, the last one specified is the only one syslogd binds to. Fix: Steal code from other udp daemons that support this. :) How-To-Repeat: Start syslogd with multiple "-b" options. It will only bind to the last one in the argument list.
Created attachment 150408 [details] implement support for multiple -b options
I had to implement this functionality at work a couple of months ago. I attached the patch we have been using.
A commit references this bug: Author: rpaulo Date: Tue Jun 16 22:26:23 UTC 2015 New revision: 284474 URL: https://svnweb.freebsd.org/changeset/base/284474 Log: syslogd: support multiple -b options. It's now possible to bind multiple sockets to different IP addresses. PR: 159305 Submitted by: Kurt Lidl <lidl pix.net> Sponsored by: Pi-Coral, Inc. Changes: head/usr.sbin/syslogd/syslogd.8 head/usr.sbin/syslogd/syslogd.c
batch change: For bugs that match the following - Status Is In progress AND - Untouched since 2018-01-01. AND - Affects Base System OR Documentation DO: Reset to open status. Note: I did a quick pass but if you are getting this email it might be worthwhile to double check to see if this bug ought to be closed.
Stas, can this PR be closed now? Thanks
The fix is present in all supported branches for long time.