git: wg: Remove unsupported endpoint.e_local and clean up related code

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


commit 345872e1f889039abc7aa54777151a24504f1bcb
Author: Aaron LI <aly at aaronly.me>
Date:   Sun Jan 14 22:50:53 2024 +0800

    wg: Remove unsupported endpoint.e_local and clean up related code
    
    On DragonFly, the socket upcall and so_pru_soreceive() cannot provide
    the local (i.e., destination) address of a received packet.  Even if
    there is the 'IP_RECVDSTADDR' control option to obtain the dst address,
    but it's unsafe to use it with the socket, because the packet is queued
    by the socket layer and the original packet may have been freed then.
    
    As a result, just remove the unsupported 'e_local' part from
    wg_endpoint.  Meanwhile, clean up the code related to the 'e_local'
    endpoint.
    
    Moreover, DragonFly by default sends UDP packets asynchronously, so
    so_pru_sosend() may just return 0 even if the packet fails to send.
    Therefore, there is no much point to check its return code and retry
    the sending.  Remove the retry code from wg_send_buf() and the
    'EADDRNOTAVAIL' check code from wg_deliver_out().

Summary of changes:
 sys/net/wg/if_wg.c | 110 ++++++++++++++++-------------------------------------
 1 file changed, 32 insertions(+), 78 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/345872e1f889039abc7aa54777151a24504f1bcb


-- 
DragonFly BSD source repository


More information about the Commits mailing list