git: wg: Further improve wg_send_buf()

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


commit 020c5f1ae6f9d04075f27aa92eb397c36d31b52c
Author: Aaron LI <aly at aaronly.me>
Date:   Thu Oct 19 16:15:44 2023 +0800

    wg: Further improve wg_send_buf()
    
    - This function is only used to send handshake packets, which are of
      known length and shorter than MHLEN, so we can just allocate an mbuf
      of packet header type and use plain memcpy() to copy the data.
    
    - Set 'M_PRIO' mbuf flag to give handshake packets high priority.
      (referred to OpenBSD)
    
    - Adjust the code a bit and remove the unnecessary 'retried' variable.

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

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/020c5f1ae6f9d04075f27aa92eb397c36d31b52c


-- 
DragonFly BSD source repository


More information about the Commits mailing list