From: angelos Date: Wed, 19 Apr 2000 03:37:35 +0000 (+0000) Subject: tdb_ref should be signed, this avoid a problem with flushing the TDB X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=b0fd41e42c52baa710e5b92ad79f90b1cafb652b;p=openbsd tdb_ref should be signed, this avoid a problem with flushing the TDB table causing repeated allocations of bypass TDBs. --- 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 */