diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1999-03-04 20:30:37 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1999-03-04 20:30:37 +0000 |
commit | 0b0c5491fc3bb273ee81f2ea915769bacdde69b6 (patch) | |
tree | 0e00ed7972505a434c974d9b4d7f9a1dacbc8c30 | |
parent | 49f8dbe67500265ce383da82c48065cb52184676 (diff) |
more paranoid maintenance
-rw-r--r-- | sys/net/pfkeyv2.c | 6 | ||||
-rw-r--r-- | sys/netinet/ip_ipsp.c | 7 |
2 files changed, 8 insertions, 5 deletions
diff --git a/sys/net/pfkeyv2.c b/sys/net/pfkeyv2.c index c34fb44d8be..e3d0ad4e8da 100644 --- a/sys/net/pfkeyv2.c +++ b/sys/net/pfkeyv2.c @@ -1301,7 +1301,7 @@ pfkeyv2_send(struct socket *socket, void *message, int len) for (tdb3 = tdb2; tdb3; tdb3 = tdb3->tdb_onext) if (tdb3 == tdb1) { - rval = EINVAL; + rval = ESRCH; goto ret; } @@ -1310,6 +1310,10 @@ pfkeyv2_send(struct socket *socket, void *message, int len) (tdb1->tdb_onext->tdb_inext == tdb1)) tdb1->tdb_onext->tdb_inext = NULL; + if ((tdb2->tdb_inext) && + (tdb2->tdb_inext->tdb_onext == tdb2)) + tdb2->tdb_inext->tdb_onext = NULL; + /* Link them */ tdb1->tdb_onext = tdb2; tdb2->tdb_inext = tdb1; diff --git a/sys/netinet/ip_ipsp.c b/sys/netinet/ip_ipsp.c index 47ca06ba871..b4766fbda30 100644 --- a/sys/netinet/ip_ipsp.c +++ b/sys/netinet/ip_ipsp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ipsp.c,v 1.35 1999/02/25 22:37:29 angelos Exp $ */ +/* $OpenBSD: ip_ipsp.c,v 1.36 1999/03/04 20:30:36 deraadt Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), @@ -669,7 +669,6 @@ tdb_delete(struct tdb *tdbp, int delchain) { u_int8_t *ptr = (u_int8_t *) &tdbp->tdb_dst; struct tdb *tdbpp; - struct flow *flow; u_int32_t hashval = tdbp->tdb_sproto + tdbp->tdb_spi, i; for (i = 0; i < SA_LEN(&tdbp->tdb_dst.sa); i++) @@ -711,9 +710,9 @@ tdb_delete(struct tdb *tdbp, int delchain) if (tdbp->tdb_xform) (*(tdbp->tdb_xform->xf_zeroize))(tdbp); - for (flow = tdbp->tdb_flow; flow; flow = tdbp->tdb_flow) + while (tdbp->tdb_flow) { - delete_flow(flow, tdbp); + delete_flow(tdbp->tdb_flow, tdbp); ipsec_in_use--; } |