svn commit: r189962 - head/sys/netipsec
VANHULLEBUS Yvan
vanhu at FreeBSD.org
Wed Mar 18 07:01:44 PDT 2009
Author: vanhu
Date: Wed Mar 18 14:01:41 2009
New Revision: 189962
URL: http://svn.freebsd.org/changeset/base/189962
Log:
Fixed deletion of sav entries in key_delsah()
Approved by: gnn(mentor)
Obtained from: NETASQ
MFC after: 1 month
Modified:
head/sys/netipsec/key.c
Modified: head/sys/netipsec/key.c
==============================================================================
--- head/sys/netipsec/key.c Wed Mar 18 13:54:35 2009 (r189961)
+++ head/sys/netipsec/key.c Wed Mar 18 14:01:41 2009 (r189962)
@@ -2687,7 +2687,10 @@ key_delsah(sah)
if (sav->refcnt == 0) {
/* sanity check */
KEY_CHKSASTATE(state, sav->state, __func__);
- KEY_FREESAV(&sav);
+ /* do NOT call KEY_FREESAV here: it will only delete the sav if refcnt == 1,
+ * where we already know that refcnt == 0
+ */
+ key_delsav(sav);
} else {
/* give up to delete this sa */
zombie++;
@@ -4131,6 +4134,8 @@ key_flush_sad(time_t now)
/* if LARVAL entry doesn't become MATURE, delete it. */
LIST_FOREACH_SAFE(sav, &sah->savtree[SADB_SASTATE_LARVAL], chain, nextsav) {
+ /* Need to also check refcnt for a larval SA ???
+ */
if (now - sav->created > V_key_larval_lifetime)
KEY_FREESAV(&sav);
}
More information about the svn-src-head
mailing list