netinet6: Improve flexibility of receiving Router Advertisement Convert the sysctl 'net.inet6.ip6.accept_rtadv' to be the default value of the per-interface flag 'ND6_IFF_ACCEPT_RTADV', making it no longer a global knob. Now the receiving RA is allowed if ip6_forwarding==0 *and* 'ND6_IFF_ACCEPT_RTADV' is set on that interface. ndp(8) already supports to toggle the 'ND6_IFF_ACCEPT_RTADV' flag via the 'accept_rtadv' option. Derived from FreeBSD.
netinet6: Improve handling of auto link-local address configuration Add a new per-interface flag 'ND6_IFF_AUTO_LINKLOCAL' and convert the sysctl 'net.inet6.ip6.auto_linklocal' to be the default value of this new per-interface flag. This allows to fine control the automatic link-local address configuration on a per-interface basis. Update ndp(8) to support to toggle the 'ND6_IFF_AUTO_LINKLOCAL' flag by adding the 'auto_linklocal' option. Document the 'IPV6CTL_AUTO_LINKLOCAL' option in the inet6(4) man page. Derived from FreeBSD.
rc.d: Add FILESYSTEMS dummy dependency This dummy dependency ensures that root and other critical local file systems are mounted. One of the intentions to add this dummy dependency is to fix the warnings caused by some ports' rc script wrongly dependent on this script. Update the rc.8 man page; meanwhile, tweak the description of other dummy dependencies a bit. Updating existing rc scripts to make use of FILESYSTEMS is coming in another commit. Obtained-from: FreeBSD
wg: Write rc(8) script to easily manage wg(4) interfaces This "wg" rc(8) script is somewhat similar to the "wg-quick" tool on Linux/FreeBSD. It can be used to quickly start/stop the wg(4) interfaces according to the wg.conf(5) configuration files in the "/etc/wireguard" directory. The syntax of wg.conf(5) configuration file is very similar to that of "wg-quick" but with necessary changes and minor additions. See wg.conf(5) for details. On the one hand, the new "wg_enable" and "wg_interfaces" variables in "/etc/rc.conf" can be used to auto-configure the wg(4) interfaces during the system startup. See rc.conf(5) for more details. On the other hand, this "wg" script can be manually called from the command-line to start/stop the wg(4) interfaces. Thanks to swildner for reviewing the man page.
wg: Import from FreeBSD without any modifications From FreeBSD main branch as of 2023-09-19. Kernel module/driver: - sys/dev/wg/compat.h - sys/dev/wg/crypto.h - sys/dev/wg/if_wg.c - sys/dev/wg/if_wg.h - sys/dev/wg/version.h - sys/dev/wg/wg_cookie.c - sys/dev/wg/wg_cookie.h - sys/dev/wg/wg_crypto.c - sys/dev/wg/wg_noise.c - sys/dev/wg/wg_noise.h Module makefile: - sys/modules/if_wg/Makefile Man page: - share/man/man4/wg.4
atomic(9): Add relaxed load/store variants from FreeBSD Obtained from FreeBSD. However, the original atomic_store_ptr() macro was causing '-Wcast-qual' warnings, so I changed it based on the NetBSD's atomic_store_relaxed(). Actually, I found NetBSD's version more clean, but we import the FreeBSD version to help import code/drivers in the future. Discussed-with: dillon
mbuf(9): Various minor updates and style cleanups - Fix the comment that MSIZE/MCLBYTES is defined in <sys/param.h> instead of <machine/param.h>; update the man page accordingly. - Adjust some type casts in mtod() to be more consistent. - Add the '__unused' attribute to actually unused parameters. - Remove unused NCL_INIT/NMB_INIT macros from 'uipc_mbuf.c'. - Use '__func__' instead of hard-coding function names. - Fix several typos. - Various style cleanups, mainly whitesapce adjustments.
mbuf(9): Use 'void *' in several public APIs to save casts in callers Update the following public APIs to use 'void *' or 'const void *' instead of 'caddr_t'/'c_caddr_t'/'char *', so that callers no longer need to do explicit casts: - m_append() - m_copyback() - m_copyback2() - m_copydata() - m_devget() - m_extadd()