git: wg: Make peer ID start from 1 (instead of 0)

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


commit 746925c90ec2eff906ce8a53ba71c7e0801b5ebd
Author: Aaron LI <aly at aaronly.me>
Date:   Tue Jan 23 23:45:55 2024 +0800

    wg: Make peer ID start from 1 (instead of 0)
    
    Use '++peer_counter' instead of 'peer_counter++' to generate the peer
    ID, so make it start from 1.
    
    Since 'peer_counter' is only used in wg_peer_create(), so move it into
    this function.  In addition, drop the unnecessary 'volatile' qualifier,
    because it's accessed with the 'sc_lock' exclusively hold.

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

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/746925c90ec2eff906ce8a53ba71c7e0801b5ebd


-- 
DragonFly BSD source repository


More information about the Commits mailing list