git: wg: Optimize wg_peer_{get,set}_endpoint()

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


commit ddba4686eee23ef75ebc427d37040b00170a1176
Author: Aaron LI <aly at aaronly.me>
Date:   Mon Jan 15 21:53:51 2024 +0800

    wg: Optimize wg_peer_{get,set}_endpoint()
    
    Similar to wg_peer_set_endpoint(), perform a comparion before really
    coping the endpoint, saving unnecessary lockings.
    
    In addition, add __predict_true() for the comparions.

Summary of changes:
 sys/net/wg/if_wg.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

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


-- 
DragonFly BSD source repository


More information about the Commits mailing list