Source-Changes-HG archive

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

[src/trunk]: src/sys/netipsec invalidate the secpolicy cache bin the PCB befo...



details:   https://anonhg.NetBSD.org/src/rev/e2584995811e
branches:  trunk
changeset: 761943:e2584995811e
user:      drochner <drochner%NetBSD.org@localhost>
date:      Fri Feb 11 17:53:35 2011 +0000

description:
invalidate the secpolicy cache bin the PCB before destroying, so that
the refcount in the (global) policies gets decremented
(This apparently was missed when the policy cache code was copied
over from KAME IPSEC.)
>From Wolfgang Stukenbrock per PR kern/44410, just fixed differently
to avoid unecessary differences to KAME.

diffstat:

 sys/netipsec/ipsec.c |  12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diffs (40 lines):

diff -r c675181a288b -r e2584995811e sys/netipsec/ipsec.c
--- a/sys/netipsec/ipsec.c      Fri Feb 11 15:38:55 2011 +0000
+++ b/sys/netipsec/ipsec.c      Fri Feb 11 17:53:35 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ipsec.c,v 1.48 2010/07/21 20:41:31 jakllsch Exp $      */
+/*     $NetBSD: ipsec.c,v 1.49 2011/02/11 17:53:35 drochner Exp $      */
 /*     $FreeBSD: /usr/local/www/cvsroot/FreeBSD/src/sys/netipsec/ipsec.c,v 1.2.2.2 2003/07/01 01:38:13 sam Exp $       */
 /*     $KAME: ipsec.c,v 1.103 2001/05/24 07:14:18 sakane Exp $ */
 
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.48 2010/07/21 20:41:31 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.49 2011/02/11 17:53:35 drochner Exp $");
 
 /*
  * IPsec controller part.
@@ -1437,6 +1437,10 @@
        if (inp->inp_sp->sp_out != NULL)
                KEY_FREESP(&inp->inp_sp->sp_out);
 
+#ifdef __NetBSD__
+       ipsec_invalpcbcache(inp->inp_sp, IPSEC_DIR_ANY);
+#endif
+
        ipsec_delpcbpolicy(inp->inp_sp);
        inp->inp_sp = NULL;
 
@@ -1521,6 +1525,10 @@
        if (in6p->in6p_sp->sp_out != NULL)
                KEY_FREESP(&in6p->in6p_sp->sp_out);
 
+#ifdef __NetBSD
+       ipsec_invalpcbcache(in6p->in6p_sp, IPSEC_DIR_ANY);
+#endif
+
        ipsec_delpcbpolicy(in6p->in6p_sp);
        in6p->in6p_sp = NULL;
 



Home | Main Index | Thread Index | Old Index