summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_ipsp.c
diff options
context:
space:
mode:
authorAngelos D. Keromytis <angelos@cvs.openbsd.org>2000-06-01 05:33:09 +0000
committerAngelos D. Keromytis <angelos@cvs.openbsd.org>2000-06-01 05:33:09 +0000
commit3b646cf9f99458cfeb077b4e87f0da9e09c312db (patch)
tree0c388673599e378a0e50ef4c89ca664e6d699551 /sys/netinet/ip_ipsp.c
parentb1da613ce9c57196ce484bdea716d4b53df05ce1 (diff)
Oops, remove bogus comment.
Diffstat (limited to 'sys/netinet/ip_ipsp.c')
-rw-r--r--sys/netinet/ip_ipsp.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/sys/netinet/ip_ipsp.c b/sys/netinet/ip_ipsp.c
index 9fc310423e7..7671c849eb3 100644
--- a/sys/netinet/ip_ipsp.c
+++ b/sys/netinet/ip_ipsp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ipsp.c,v 1.87 2000/06/01 05:08:42 angelos Exp $ */
+/* $OpenBSD: ip_ipsp.c,v 1.88 2000/06/01 05:33:08 angelos Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
@@ -1112,6 +1112,13 @@ tdb_delete(struct tdb *tdbp, int delchain, int expflags)
u_int32_t hashval = tdbp->tdb_sproto + tdbp->tdb_spi;
int s;
+ /* If it's still referenced, go on */
+ if (tdbp->tdb_ref-- > 0)
+ {
+ tdbp->tdb_flags |= TDBF_INVALID;
+ return;
+ }
+
/* When deleting the bypass tdb, skip the hash table code. */
if (tdbp == tdb_bypass && tdbp != NULL)
{
@@ -1295,14 +1302,8 @@ tdb_delete(struct tdb *tdbp, int delchain, int expflags)
if (tdbp == tdb_bypass)
tdb_bypass = NULL;
- /* Don't always delete TDBs as they may be referenced by something else */
- if (--tdbp->tdb_ref <= 0)
- {
- FREE(tdbp, M_TDB);
- tdb_count--;
- }
- else
- tdbp->tdb_flags |= TDBF_INVALID;
+ FREE(tdbp, M_TDB);
+ tdb_count--;
if (delchain && tdbpn)
tdb_delete(tdbpn, delchain, expflags);
@@ -1311,7 +1312,7 @@ tdb_delete(struct tdb *tdbp, int delchain, int expflags)
}
/*
- * Run once, from system boot.
+ * Initialize a TDB structure.
*/
int
tdb_init(struct tdb *tdbp, u_int16_t alg, struct ipsecinit *ii)