opnsense-src/sys/dev/wg
Aaron LI ba560cd8fb wg: Improve wg_peer_alloc() to simplify the calling
Move the necessary extra logics (i.e., noise_remote_enable() and
TAILQ_INSERT_TAIL()) from wg_ioctl_set() to wg_peer_alloc(), and thus
make it easier to be called.  Actually, the updated version is more
asymmetric to wg_peer_destroy() and thus less likely to be misused.
Meanwhile, rename it to wg_peer_create() to look more consistent with
wg_peer_destroy().

Reviewed by:	aly_aaronly.me (diff), markj
Obtained from:	DragonflyBSD 902964ab24ba (with some changes)

(cherry picked from commit 7121e9414f294d116caeadd07ebd969136d3a631)
2025-04-25 22:19:47 -05:00
..
compat.h wg: Drop the compat shim for sbcreatecontrol(). 2022-11-11 14:18:48 -08:00
crypto.h wg: Trim compat shims for versions older than current stable/13. 2022-10-28 13:36:13 -07:00
if_wg.c wg: Improve wg_peer_alloc() to simplify the calling 2025-04-25 22:19:47 -05:00
if_wg.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
version.h
wg_cookie.c wg: uma_zcreate() does not fail 2024-05-02 09:25:08 -04:00
wg_cookie.h
wg_crypto.c wg: Trim compat shims for versions older than current stable/13. 2022-10-28 13:36:13 -07:00
wg_noise.c if_wg: fix access to noise_local->l_has_identity and l_private 2024-01-29 23:37:33 -06:00
wg_noise.h