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)

(cherry picked from commit 7121e9414f294d116caeadd07ebd969136d3a631)

Details

Provenance
aly_aaronly.meAuthored on Fri, Apr 18, 12:30 AM
kevansCommitted on Sat, Apr 26, 3:19 AM
Parents
rGb7f4fcc27f4f: Fix share/zoneinfo for DIRDEPS_BUILD
Branches
Unknown
Tags
Unknown