git: wg: Improve wg_peer_alloc() to simplify the calling

Aaron LI aly at crater.dragonflybsd.org
Thu Feb 8 00:32:28 PST 2024


commit 902964ab24ba9d2c978017d369c0faa8d2fe0f9e
Author: Aaron LI <aly at aaronly.me>
Date:   Sun Oct 22 00:19:46 2023 +0800

    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().
    
    Referred-to: OpenBSD

Summary of changes:
 sys/net/wg/if_wg.c | 33 ++++++++++++++++++---------------
 1 file changed, 18 insertions(+), 15 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/902964ab24ba9d2c978017d369c0faa8d2fe0f9e


-- 
DragonFly BSD source repository


More information about the Commits mailing list