git: wg: Port #22: replace udp_set_kernel_tunneling() with socket upcall

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


commit a116016b2fee56156bb6d351fdd1f7e1abe207ed
Author: Aaron LI <aly at aaronly.me>
Date:   Wed Oct 25 09:27:37 2023 +0800

    wg: Port #22: replace udp_set_kernel_tunneling() with socket upcall
    
    Implement the wg_upcall() function as the socket's so_upcall() method to
    receive data from the kernel socket.  Adjust the original wg_input()
    function to process the received data from wg_upcall().  Since we
    already read the UDP data from the socket, so there is no more UDP
    header in the given mbuf packet.
    
    Adjust the socreate() invocation; however, we still need to perform
    extra ucred check to achieve the wanted permission controls.
    
    Also replace sosend() with so_pru_sosend(), as suggested by its
    description in <sys/socketops.h>.

Summary of changes:
 sys/net/wg/if_wg.c | 61 +++++++++++++++++++++++++++++++++++++-----------------
 1 file changed, 42 insertions(+), 19 deletions(-)

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


-- 
DragonFly BSD source repository


More information about the Commits mailing list