Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/net wg: Count down wg_npeers in wg_destroy_all_peers too.



details:   https://anonhg.NetBSD.org/src/rev/6a518ff3ed98
branches:  trunk
changeset: 938047:6a518ff3ed98
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 31 20:21:09 2020 +0000

description:
wg: Count down wg_npeers in wg_destroy_all_peers too.

Doesn't actually make a difference -- wg_destroy_all_peers is only
used when we're destroying the wg instance altogether -- but let's
not leave rakes to step on.

diffstat:

 sys/net/if_wg.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r 98d28d889cab -r 6a518ff3ed98 sys/net/if_wg.c
--- a/sys/net/if_wg.c   Mon Aug 31 20:20:48 2020 +0000
+++ b/sys/net/if_wg.c   Mon Aug 31 20:21:09 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_wg.c,v 1.34 2020/08/31 20:20:48 riastradh Exp $     */
+/*     $NetBSD: if_wg.c,v 1.35 2020/08/31 20:21:09 riastradh Exp $     */
 
 /*
  * Copyright (C) Ryota Ozaki <ozaki.ryota%gmail.com@localhost>
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wg.c,v 1.34 2020/08/31 20:20:48 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wg.c,v 1.35 2020/08/31 20:21:09 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -3327,6 +3327,7 @@
        mutex_enter(wg->wg_lock);
        WG_PEER_WRITER_FOREACH(wgp, wg) {
                WG_PEER_WRITER_REMOVE(wgp);
+               wg->wg_npeers--;
                mutex_enter(wgp->wgp_lock);
                wgp->wgp_state = WGP_STATE_DESTROYING;
                pserialize_perform(wgp->wgp_psz);



Home | Main Index | Thread Index | Old Index