summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorangelos <angelos@openbsd.org>2001-05-29 01:19:37 +0000
committerangelos <angelos@openbsd.org>2001-05-29 01:19:37 +0000
commita7914fe2ebd90ffad5df9272e6bf73490f62e22d (patch)
treee47668f3867450a191cf2f482b30e82c8fd1cf63
parentKeep track of when a TDB was last marked/unmared as SKIPCRYPTO, and (diff)
downloadwireguard-openbsd-a7914fe2ebd90ffad5df9272e6bf73490f62e22d.tar.xz
wireguard-openbsd-a7914fe2ebd90ffad5df9272e6bf73490f62e22d.zip
Record last use time for SAs.
-rw-r--r--sys/netinet/ipsec_input.c4
-rw-r--r--sys/netinet/ipsec_output.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/sys/netinet/ipsec_input.c b/sys/netinet/ipsec_input.c
index 11fa75441ba..d6eaf8ebe66 100644
--- a/sys/netinet/ipsec_input.c
+++ b/sys/netinet/ipsec_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipsec_input.c,v 1.40 2001/05/27 03:49:14 angelos Exp $ */
+/* $OpenBSD: ipsec_input.c,v 1.41 2001/05/29 01:19:37 angelos Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
@@ -268,6 +268,8 @@ ipsec_common_input_cb(struct mbuf *m, struct tdb *tdbp, int skip, int protoff,
af = tdbp->tdb_dst.sa.sa_family;
sproto = tdbp->tdb_sproto;
+ tdbp->tdb_last_used = time.tv_sec;
+
/* Sanity check */
if (m == NULL)
{
diff --git a/sys/netinet/ipsec_output.c b/sys/netinet/ipsec_output.c
index 26dafffce9e..f613e32c475 100644
--- a/sys/netinet/ipsec_output.c
+++ b/sys/netinet/ipsec_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipsec_output.c,v 1.11 2001/05/28 05:30:29 angelos Exp $ */
+/* $OpenBSD: ipsec_output.c,v 1.12 2001/05/29 01:19:37 angelos Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
@@ -294,6 +294,8 @@ ipsp_process_done(struct mbuf *m, struct tdb *tdb, struct tdb *tdb2)
struct tdb_ident *tdbi;
struct m_tag *mtag;
+ tdb->tdb_last_used = time.tv_sec;
+
switch (tdb->tdb_dst.sa.sa_family)
{
#ifdef INET