diff options
author | 1999-07-06 20:54:03 +0000 | |
---|---|---|
committer | 1999-07-06 20:54:03 +0000 | |
commit | b720148f524b303c5b629ebaa03718f27eaa20a2 (patch) | |
tree | 58b28f27ee20ddad004ea8e9ecb682a578becb50 | |
parent | Added TCP_SIGNATURE option. (diff) | |
download | wireguard-openbsd-b720148f524b303c5b629ebaa03718f27eaa20a2.tar.xz wireguard-openbsd-b720148f524b303c5b629ebaa03718f27eaa20a2.zip |
ipsec_in_use could get out of sync. (Also niklas@. angelos@ ok)
-rw-r--r-- | sys/net/pfkeyv2.c | 7 | ||||
-rw-r--r-- | sys/netinet/ip_ipsp.c | 7 |
2 files changed, 3 insertions, 11 deletions
diff --git a/sys/net/pfkeyv2.c b/sys/net/pfkeyv2.c index 46b84dc1b5e..acf9af33e1a 100644 --- a/sys/net/pfkeyv2.c +++ b/sys/net/pfkeyv2.c @@ -1294,7 +1294,6 @@ pfkeyv2_send(struct socket *socket, void *message, int len) 0, (struct rtentry **) 0); delete_flow(flow, flow->flow_sa); - ipsec_in_use--; } else if (!replace) { @@ -1312,7 +1311,6 @@ pfkeyv2_send(struct socket *socket, void *message, int len) goto splxret; } - ipsec_in_use++; sa2->tdb_cur_allocations++; } else @@ -1334,7 +1332,6 @@ pfkeyv2_send(struct socket *socket, void *message, int len) delete_flow(flow2, sa2); goto splxret; } - ipsec_in_use++; } else if (rt_setgate(rt, rt_key(rt), (struct sockaddr *) &encapgw)) { @@ -1362,7 +1359,6 @@ pfkeyv2_send(struct socket *socket, void *message, int len) (struct rtentry **) 0); delete_flow(flow2, flow2->flow_sa); - ipsec_in_use--; } else if (!replace) { @@ -1385,11 +1381,9 @@ pfkeyv2_send(struct socket *socket, void *message, int len) delete_flow(flow, sa2); delete_flow(flow2, sa2); - ipsec_in_use--; goto splxret; } - ipsec_in_use++; sa2->tdb_cur_allocations++; } else @@ -1418,7 +1412,6 @@ pfkeyv2_send(struct socket *socket, void *message, int len) delete_flow(flow2, sa2); goto splxret; } - ipsec_in_use++; } else if (rt_setgate(rt, rt_key(rt), (struct sockaddr *) &encapgw)) diff --git a/sys/netinet/ip_ipsp.c b/sys/netinet/ip_ipsp.c index 749c747c347..54d22e3d5f6 100644 --- a/sys/netinet/ip_ipsp.c +++ b/sys/netinet/ip_ipsp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ipsp.c,v 1.47 1999/07/06 20:17:52 cmetz Exp $ */ +/* $OpenBSD: ip_ipsp.c,v 1.48 1999/07/06 20:54:03 ho Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), @@ -449,6 +449,7 @@ get_flow(void) MALLOC(flow, struct flow *, sizeof(struct flow), M_TDB, M_WAITOK); bzero(flow, sizeof(struct flow)); + ipsec_in_use++; return flow; } @@ -834,6 +835,7 @@ delete_flow(struct flow *flow, struct tdb *tdb) } } + ipsec_in_use--; FREE(flow, M_TDB); } @@ -890,10 +892,7 @@ tdb_delete(struct tdb *tdbp, int delchain, int expflags) (*(tdbp->tdb_xform->xf_zeroize))(tdbp); while (tdbp->tdb_flow) - { delete_flow(tdbp->tdb_flow, tdbp); - ipsec_in_use--; - } /* Cleanup SA-Bindings */ for (tdbpp = TAILQ_FIRST(&tdbp->tdb_bind_in); tdbpp; |