Module Name:    src
Committed By:   riastradh
Date:           Mon Aug 31 20:21:09 UTC 2020

Modified Files:
        src/sys/net: if_wg.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/net/if_wg.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/net/if_wg.c
diff -u src/sys/net/if_wg.c:1.34 src/sys/net/if_wg.c:1.35
--- src/sys/net/if_wg.c:1.34	Mon Aug 31 20:20:48 2020
+++ src/sys/net/if_wg.c	Mon Aug 31 20:21:09 2020
@@ -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.ry...@gmail.com>
@@ -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 @@ restart:
 	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);

Reply via email to