git: wg: Refactor socket create/bind/close operations

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


commit a36b0bc581ec78f5ed39de882b9745efd907087e
Author: Aaron LI <aly at aaronly.me>
Date:   Tue Nov 28 10:28:59 2023 +0800

    wg: Refactor socket create/bind/close operations
    
    - Add the wg_socket_open() function to do socket creation and binding
      for one AF, and then use it to simplify the wg_socket_init() function.
      Meanwhil, wg_socket_bind() thus becomes obsolete and is removed.
    - Clean up wg_socket_uninit(), wg_socket_set_cookie() and
      wg_socket_set_sockopt().
    - Add the 'so_lock' lock to protect the 'struct wg_socket' fields.
      Update wg_send() accordingly.
    - Add a comment about EADDRNOTAVAIL and single-stack support.
    
    Referred to OpenBSD.

Summary of changes:
 sys/net/wg/if_wg.c | 326 +++++++++++++++++++++++++++++------------------------
 1 file changed, 178 insertions(+), 148 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/a36b0bc581ec78f5ed39de882b9745efd907087e


-- 
DragonFly BSD source repository


More information about the Commits mailing list