git: wg: Implement wg_peer_{set, get}_endpoint() to set the remote endpoint

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


commit 9f69aef9c659f6223a4f71eef9afd8d77a890433
Author: Aaron LI <aly at aaronly.me>
Date:   Sat Jan 13 16:19:38 2024 +0800

    wg: Implement wg_peer_{set,get}_endpoint() to set the remote endpoint
    
    Moving the setting and getting the peer remote endpoint to their own
    separate functions.  This cleans up the already lengthy
    wg_ioctl_{set,get}() functions.
    
    In addition, these two functions fix the following two issues:
    - The 'p_endpoint_lock' wasn't acquired before setting/getting the
      endpoint address.
    - The local address 'e_local' wasn't cleared when setting the remote
      endpoint address.
    
    Referred-to: OpenBSD

Summary of changes:
 sys/net/wg/if_wg.c | 67 +++++++++++++++++++++++++++++++++++++-----------------
 1 file changed, 46 insertions(+), 21 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/9f69aef9c659f6223a4f71eef9afd8d77a890433


-- 
DragonFly BSD source repository


More information about the Commits mailing list