git: wg: Port #20: rewrite ioctl API based on OpenBSD's version

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


commit a4e2140561798188dfcdda3cb16a28a24b792e63
Author: Aaron LI <aly at aaronly.me>
Date:   Sat Oct 21 17:17:59 2023 +0800

    wg: Port #20: rewrite ioctl API based on OpenBSD's version
    
    DragonFly doesn't support the nv(9) API and I don't want to port it from
    FreeBSD.  So rewrite the ioctl API based on OpenBSD's version, which
    uses the wg_interface_io/wg_peer_io/wg_aip_io structs and is more
    straightforward.
    
    - Replace if_wg.h with OpenBSD's version, with minor style adjustments.
    - Replace 'WG_INTERFACE_HAS_RTABLE' with 'WG_INTERFACE_HAS_COOKIE', as
      the FreeBSD WG supports the latter.
    - Add compile-time assertions to make sure WG_KEY_SIZE is big enough.
    - Replace 'wg_timespec64' struct with the standard 'timespec' struct
      since the former is no longer needed.
    - Bring in custom peer description support from OpenBSD.
    
    I'll later port the WG support to ifconfig(8) from OpenBSD as well.

Summary of changes:
 sys/net/wg/if_wg.c | 634 +++++++++++++++++++++++------------------------------
 sys/net/wg/if_wg.h |  87 +++++++-
 2 files changed, 352 insertions(+), 369 deletions(-)

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


-- 
DragonFly BSD source repository


More information about the Commits mailing list