wg: Further improve wg_send_buf()
commit020c5f1ae6f9d04075f27aa92eb397c36d31b52c
authorAaron LI <aly@aaronly.me>
Thu, 19 Oct 2023 08:15:44 +0000 (19 16:15 +0800)
committerAaron LI <aly@aaronly.me>
Thu, 8 Feb 2024 06:44:46 +0000 (8 14:44 +0800)
treef731de304d898dd4fe7e5542aa5e2ec9e4c2bd62
parentbd36992fc0f235b262366df0c103c208f8469af0
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.
sys/net/wg/if_wg.c