aboutsummaryrefslogtreecommitdiff
path: root/gnu/usr.bin/diff
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2025-01-14 14:19:56 +0000
committerMark Johnston <markj@FreeBSD.org>2025-01-14 14:19:56 +0000
commitae4f708f0b383277505daa191e21db399b558839 (patch)
treeb8179943cc002b4307b1be52aaf344eff7d5d604 /gnu/usr.bin/diff
parentf78fe930854cac6eed55859b45e0a7b5d87189d6 (diff)
syslogd: Ensure that forwarded messages are sent from port 514
Prior to commit 4ecbee2760f7, syslogd used its listening socket(s) to forward messages to remote hosts, when so configured. As a consequence, they are sent from the address+port to which those sockets are bound, typically 0.0.0.0:514. When in capability mode, sendto() is not permitted, so we instead pre-create sockets and connect them to the forwarding addresses, letting the kernel pick an ephemeral source port. However, this doesn't match syslogd's previous behaviour, breaking some setups. So, restore the old behaviour by binding forwarding sockets to the addresses on which syslogd is listening. Since we cannot use the same sockets for receiving messages and also for forwarding them, use SO_REUSEPORT to enable duplicate bindings to port 514, relying on the existing behaviour that the first socket bound to that port is the one that actually receives messages. Add some regression tests to cover this and related functionality of syslogd's -a option. Reviewed by: jfree Reported by: Michael Butler <imb@protected-networks.net> Fixes: 4ecbee2760f7 ("syslogd: Open forwarding socket descriptors") Differential Revision: https://reviews.freebsd.org/D48222
Diffstat (limited to 'gnu/usr.bin/diff')
0 files changed, 0 insertions, 0 deletions