HomeFreeBSD

wg: Improve wg_peer_alloc() to simplify the calling

Description

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)

Details

Provenance
aly_aaronly.meAuthored on Apr 18 2025, 12:30 AM
kevansCommitted on Apr 18 2025, 12:30 AM
Differential Revision
D49796: wg: Improve wg_peer_alloc() to simplify the calling
Parents
rG514c2930292e: vm_object: use iterators in page_collect_flush()
Branches
Unknown
Tags
Unknown