opnsense-src/usr.sbin
Mark Johnston ae4f708f0b syslogd: Ensure that forwarded messages are sent from port 514
Prior to commit 4ecbee2760, 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:		4ecbee2760 ("syslogd: Open forwarding socket descriptors")
Differential Revision:	https://reviews.freebsd.org/D48222
2025-01-14 14:19:56 +00:00
..
ac Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
accton Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
acpi acpidump(8): add const qualifier to the known tables array 2024-10-23 23:00:10 +03:00
adduser pw: set the user's home directory mode if it existed 2024-12-01 13:08:31 -06:00
apm Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
apmd Update Makefile.depend files 2024-10-14 10:26:17 -07:00
arp arp(8): Complete libxo transition 2024-10-13 02:21:45 +08:00
audit package: move OpenBSM auditing into its own package 2024-04-28 22:33:06 -06:00
auditd package: move OpenBSM auditing into its own package 2024-04-28 22:33:06 -06:00
auditdistd package: move OpenBSM auditing into its own package 2024-04-28 22:33:06 -06:00
auditreduce package: move OpenBSM auditing into its own package 2024-04-28 22:33:06 -06:00
authpf Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
autofs Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
bhyve bhyve: Implement the libslirp notify callback 2025-01-07 14:33:45 +00:00
bhyvectl bhyvectl: Convert to use vm_openf() 2024-11-05 01:40:41 +00:00
bhyveload Update Makefile.depend files 2024-10-14 10:26:17 -07:00
binmiscctl manuals: Fix typos in -offset for .Bd and .Bl 2024-10-03 14:49:31 -03:00
blacklistctl Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
blacklistd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
bluetooth rtlbtfw: Firmware loader for Realtek 87XX/88XX bluetooth USB adaptors 2024-11-07 02:30:29 +03:00
boot0cfg Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
bootparamd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
boottrace spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
bsdconfig Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
bsdinstall bsdinstall: Fix a typo in a comment 2025-01-06 22:56:49 +00:00
bsnmpd libbsnmptools: avoid uninitialized snmptoolctx->passwd with empty password 2025-01-10 21:08:02 -08:00
btxld Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
camdd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
cdcontrol Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
certctl certctl: Set METALOG ownership to root:wheel 2024-12-30 12:32:23 -05:00
chkgrp Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
chown Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
chroot Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
ckdist Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
clear_locks Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
config config: Remove a stray semicolon 2024-10-24 23:04:48 +08:00
cpucontrol Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
crashinfo Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
cron Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
crunch Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
ctladm Update Makefile.depend files 2024-10-14 10:26:17 -07:00
ctld ctld: fix several process setup/teardown bugs 2024-09-18 14:06:31 -06:00
cxgbetool cxgbetool.8: Consistently use .Cm for loader tunables 2024-12-10 15:34:10 -05:00
daemon daemon: tests: add a test for missed SIGTERM 2024-11-19 13:51:27 -06:00
dconschat dconschat: Increase WARNS to 2 2024-11-03 15:18:39 -05:00
devctl Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
devinfo devinfo: Output device description in verbose mode 2024-10-16 14:09:05 -04:00
diskinfo Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
dumpcis Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
editmap Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
edquota Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
efibootmgr manuals: Fix "unusual .Xr" warnings with a script 2024-10-15 17:18:14 -03:00
efidp Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
efitable Update Makefile.depend files 2024-10-14 10:26:17 -07:00
efivar Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
efiwake Update Makefile.depend files 2024-10-14 10:26:17 -07:00
etcupdate etcupdate(8): improve phrasing 2024-07-16 15:17:31 -04:00
extattr Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
extattrctl Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
fdcontrol Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
fdformat Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
fdread Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
fdwrite fdwrite.c: initialize pointers to NULL and a few other cleanups 2024-04-11 12:24:36 -06:00
fifolog Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
flowctl Purge more stray embedded $FreeBSD$ strings 2023-09-25 07:54:56 -07:00
freebsd-update freebsd-update: improve pkgbase check 2024-11-02 15:24:39 -04:00
fstyp fstyp: search for file system headers with the largest offset first 2024-12-03 23:45:09 -09:00
ftp-proxy Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
fwcontrol fwcontrol: Allocate full fw_asyreq structures passed to the kernel 2024-07-19 13:09:32 -04:00
fwget fwget: Add needed firmware for Radeon 740M GPU 2025-01-12 12:50:13 +01:00
getfmac Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
getpmac Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
gpioctl Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
gssd manuals: Fix dates 2024-10-28 12:26:03 -03:00
gstat usr.sbin/gstat: add microsecond precision for disk latency 2024-08-04 11:31:06 +03:00
hyperv Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
i2c manuals: Remove trailing spaces 2024-11-04 11:26:14 -04:00
ifmcstat Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
inetd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
iostat Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
iovctl Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
ip6addrctl getaddrinfo.{1,3}: Cross-reference ip6addrctl(8) 2024-09-06 12:34:32 -06:00
ipfwpcap Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
iscsid Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
jail jail: Let a couple of parameter types be specified as lists 2024-11-19 21:05:24 +00:00
jexec jail: only chdir to user's home directory when user is specified 2024-08-12 15:23:28 -07:00
jls jls(8): Complete libxo transition 2024-10-13 02:21:47 +08:00
kbdcontrol kbdcontrol: correct bell frequency for vt(4) 2024-11-01 11:54:40 -04:00
kbdmap Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
keyserv Fix enum warning in keyserv 2024-07-31 21:28:42 +02:00
kldxref libkldelf: add a private library for kernel/kld-related ELF parsing 2024-10-18 20:20:13 +00:00
lastlogin manuals: Fix "unusual .Xr" warnings with a script 2024-10-15 17:18:14 -03:00
lpr pac: Consistently use item count as the first argument to calloc 2025-01-03 10:44:27 -05:00
lptcontrol Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
mailstats Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
mailwrapper manuals: Fix "unusual .Xr" warnings with a script 2024-10-15 17:18:14 -03:00
makefs makefs: Handle special file types when creating a zpool 2025-01-07 14:32:20 +00:00
makemap Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
manctl Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
memcontrol Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
mfiutil manuals: Misc macro typos 2024-09-21 05:25:15 -06:00
mixer mixer: Fix a bogus free() call in the main loop 2024-10-23 22:12:45 +00:00
mld6query usr.sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
mlx5tool manuals: Misc macro typos 2024-09-21 05:25:15 -06:00
mlxcontrol Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
mount_smbfs Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
mountd exports.5: Document the current behavior of -alldirs 2024-12-28 13:51:08 -08:00
moused Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
mpsutil mpsutil: Clean up libutil deps 2024-01-24 17:10:24 -05:00
mptable Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
mptutil Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
mtest Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
ndp ndp: Bring back the -A option for the netlink implementation 2024-11-01 00:32:14 +08:00
newsyslog newsyslog.conf(5): Remove duplicate word 2024-11-29 13:00:54 +08:00
nfscbd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
nfsd nfsd.c: Synchronize error handling 2024-09-29 13:11:54 -07:00
nfsdumpstate Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
nfsrevoke Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
nfsuserd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
ngctl usr.sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
nghook Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
nmtree Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
nologin Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
nscd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
ntp ntp: Switch to upstream man pages 2024-11-11 19:10:04 -08:00
nvmfd nvmf: Switch several ioctls to using nvlists 2024-12-30 13:52:21 -05:00
nvram Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
ofwdump Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
pciconf pciconf(8): dump AMD IOMMU Base Capability 2024-04-10 08:28:24 +03:00
periodic Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
pkg pkg: retire backwards compatibility bootstrap support 2025-01-14 08:42:36 -05:00
pmc pmc: Fix some problems with the makefile 2024-02-16 09:50:43 -05:00
pmcannotate usr.sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
pmccontrol usr.sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
pmcstat usr.sbin: Remove repeated words 2024-04-11 11:53:37 -06:00
pmcstudy Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
pnfsdscopymr Update Makefile.depend files 2024-10-14 10:26:17 -07:00
pnfsdsfile Update Makefile.depend files 2024-10-14 10:26:17 -07:00
pnfsdskill Update Makefile.depend files 2024-10-14 10:26:17 -07:00
pnpinfo Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
powerd powerd: use nlsysevent if possible 2024-10-08 08:40:58 +02:00
ppp tcp: cleanup of nits after use of accessor tcp_get_flags 2024-12-19 16:37:24 +01:00
pppctl Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
praliases Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
praudit praudit: correct test case 2024-11-04 08:57:13 -05:00
prometheus_sysctl_exporter Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
pstat Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
pw pw: tests: add a test for -M with a pre-existing home directory 2024-12-01 13:10:35 -06:00
pwd_mkdb manuals: Fix typos in -offset for .Bd and .Bl 2024-10-03 14:49:31 -03:00
pwm Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
quot Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
quotaon Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
rarpd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
repquota Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
rip6query Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
rmt Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
route6d Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
rpc.lockd Add man page for nfslockd. 2024-05-10 11:23:13 +02:00
rpc.statd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
rpc.tlsclntd manuals: Fix "unusual .Xr" warnings with a script 2024-10-15 17:18:14 -03:00
rpc.tlsservd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
rpc.umntall Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
rpc.yppasswdd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
rpc.ypupdated Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
rpc.ypxfrd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
rpcbind rpcbind: remove extraneous check for nconf not being unix(4) 2025-01-08 20:00:12 -08:00
rrenumd Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
rtadvctl rtadvctl: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) 2024-04-28 21:24:46 -06:00
rtadvd rtadvd(8): support PREF64 (RFC 8781) 2024-05-23 14:40:48 -06:00
rtprio Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
rtsold usr.sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
rwhod Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
sa Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
sendmail Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
service manuals: Fix typos in -offset for .Bd and .Bl 2024-10-03 14:49:31 -03:00
services_mkdb services: fix typo ucp -> udp 2024-12-01 00:53:47 +03:00
sesutil sesutil(8): Complete libxo transition 2024-10-13 02:21:46 +08:00
setfib Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
setfmac Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
setpmac Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
smbmsg Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
snapinfo man filesystems: fix xrefs after move to section 4 2024-05-16 10:25:29 -06:00
spi Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
spkrtest Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
spray Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
syslogd syslogd: Ensure that forwarded messages are sent from port 514 2025-01-14 14:19:56 +00:00
sysrc Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
tcpdchk Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
tcpdmatch Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
tcpdrop usr.sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
tcpdump tcpdump: Update to 4.99.5 2024-09-23 20:23:25 +01:00
tcpsso tcpsso: remove support for some IPPROTO_TCP-level socket option names 2024-08-30 09:32:50 +02:00
tests Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
traceroute tcp: extend the use of the th_flags accessor function 2024-11-29 09:48:23 +01:00
traceroute6 tcp: extend the use of the th_flags accessor function 2024-11-29 09:48:23 +01:00
trim Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
tzsetup tzsetup: correct timezone symlink target 2024-09-30 10:22:34 -04:00
uathload Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
uefisign Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
ugidfw Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
uhsoctl usr.sbin/uhsoctl: correct SIOCDIFADDR calls to use ifreq 2024-07-22 14:58:19 +00:00
unbound Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
usbconfig usbconfig: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) 2024-04-28 21:30:55 -06:00
usbdump Give usbdump a '-u' option for unbuffered output. 2024-10-21 11:21:05 +00:00
utx Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
valectl Update Makefile.depend files 2024-10-14 10:26:17 -07:00
vidcontrol Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
vigr Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
vipw Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
wake Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
watch Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
watchdogd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
wlandebug Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
wpa wpa_supplicant: xref relevant wpa_passphrase(8) 2024-10-15 17:18:02 -03:00
yp_mkdb Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
ypbind Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
ypldap ypldap(8): Fix grammar in ypldap.c 2024-02-13 14:11:07 +08:00
yppoll Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
yppush Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
ypserv Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
ypset Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
zdump Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
zic Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
zonectl Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
zzz Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
Makefile Revert "isp: Fix abort issue introduced by previous commit" 2025-01-08 13:20:09 -05:00
Makefile.aarch64 bhyvectl: Add arm64 bits and hook it up to the build 2024-05-01 08:33:23 -04:00
Makefile.amd64 Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
Makefile.i386 Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
Makefile.inc Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
Makefile.powerpc Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
Makefile.riscv bhyve/riscv: Initial import. 2024-10-31 20:24:12 +00:00