From cab5c37944451b9ac7117ad13557f50c18a8592a Mon Sep 17 00:00:00 2001 From: "Angelos D. Keromytis" Date: Wed, 19 Apr 2000 03:37:37 +0000 Subject: tdb_ref should be signed, this avoid a problem with flushing the TDB table causing repeated allocations of bypass TDBs. --- sys/netinet/ip_ipsp.c | 6 ++++-- sys/netinet/ip_ipsp.h | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'sys/netinet') diff --git a/sys/netinet/ip_ipsp.c b/sys/netinet/ip_ipsp.c index 3ef72b1e048..aaf74b13ad7 100644 --- a/sys/netinet/ip_ipsp.c +++ b/sys/netinet/ip_ipsp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ipsp.c,v 1.82 2000/03/28 07:04:02 angelos Exp $ */ +/* $OpenBSD: ip_ipsp.c,v 1.83 2000/04/19 03:37:35 angelos Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), @@ -559,7 +559,7 @@ reserve_spi(u_int32_t sspi, u_int32_t tspi, union sockaddr_union *src, if (tdbp != (struct tdb *) NULL) continue; - + MALLOC(tdbp, struct tdb *, sizeof(struct tdb), M_TDB, M_WAITOK); bzero((caddr_t) tdbp, sizeof(struct tdb)); @@ -1083,6 +1083,7 @@ tdb_rehash(void) tdbp->tdb_hnext = new_tdbh[hashval]; new_tdbh[hashval] = tdbp; } + FREE(tdbh, M_TDB); tdbh = new_tdbh; } @@ -1377,6 +1378,7 @@ tdb_delete(struct tdb *tdbp, int delchain, int expflags) if (delchain && tdbpn) tdb_delete(tdbpn, delchain, expflags); + splx(s); } diff --git a/sys/netinet/ip_ipsp.h b/sys/netinet/ip_ipsp.h index 98fafc21b10..2d1111daa03 100644 --- a/sys/netinet/ip_ipsp.h +++ b/sys/netinet/ip_ipsp.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ipsp.h,v 1.63 2000/03/29 07:09:57 angelos Exp $ */ +/* $OpenBSD: ip_ipsp.h,v 1.64 2000/04/19 03:37:36 angelos Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), @@ -271,7 +271,7 @@ struct tdb /* tunnel descriptor block */ * tdb_exp_first_use <= curtime */ u_int64_t tdb_cryptoid; /* Crypto session ID */ - u_int32_t tdb_ref; /* References */ + int32_t tdb_ref; /* References */ u_int32_t tdb_spi; /* SPI */ u_int16_t tdb_amxkeylen; /* Raw authentication key length */ u_int16_t tdb_emxkeylen; /* Raw encryption key length */ -- cgit v1.2.3