git: wg: Clean up and improve wg_deliver_{in,out}() logic

Aaron LI aly at crater.dragonflybsd.org
Thu Feb 15 00:28:03 PST 2024


commit b85a20f3c1f2bb583ea1f5b284a6375c77afa5ad
Author: Aaron LI <aly at aaronly.me>
Date:   Mon Jan 15 22:14:16 2024 +0800

    wg: Clean up and improve wg_deliver_{in,out}() logic
    
    - Refactor the code flow and avoid the 'goto' cases.
    - Add 'oerrors' increment statement to wg_send(), pairing with the
      existing 'opackets' and 'obytes' increments; this make the code more
      clear.
    - Assign 'mycpuid' to a local variable, avoiding repeated fetches within
      the loop.
    - Add comment about why to always trigger the keepalive timers.

Summary of changes:
 sys/net/wg/if_wg.c | 71 +++++++++++++++++++++++++++++-------------------------
 1 file changed, 38 insertions(+), 33 deletions(-)

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


-- 
DragonFly BSD source repository


More information about the Commits mailing list