syslogd: Handle connection errors when setting up forwarding sockets
Since syslogd was converted to run in a Capsicum sandbox, it needs to
explicitly connect() its forwarding sockets rather than using sendmsg().
At the time syslogd starts during boot, some of its forwarding
destinations may not be routable, in which case connect() fails.
Fix this by making connect() failures non-fatal, and use cap_net to
lazily connect sockets once something actually tries logging to the
destination.
Add a regression test.
Reported by: ae
Reviewed by: ae
Discussed with: jfree
Fixes: 4ecbee2760f7 ("syslogd: Open forwarding socket descriptors")
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D57394