diff options
author | 2004-06-21 23:50:35 +0000 | |
---|---|---|
committer | 2004-06-21 23:50:35 +0000 | |
commit | 3212dc310ec9c3aa2cd9e7180fe81d66a37e4443 (patch) | |
tree | b8b428eb79259cc5ab8e628e0b78b672af7aa38b /sys/netinet/ipsec_input.c | |
parent | When in_ifinit fails and we've created a new address, clean it up before (diff) | |
download | wireguard-openbsd-3212dc310ec9c3aa2cd9e7180fe81d66a37e4443.tar.xz wireguard-openbsd-3212dc310ec9c3aa2cd9e7180fe81d66a37e4443.zip |
First step towards more sane time handling in the kernel -- this changes
things such that code that only need a second-resolution uptime or wall
time, and used to get that from time.tv_secs or mono_time.tv_secs now get
this from separate time_t globals time_second and time_uptime.
ok art@ niklas@ nordin@
Diffstat (limited to 'sys/netinet/ipsec_input.c')
-rw-r--r-- | sys/netinet/ipsec_input.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/sys/netinet/ipsec_input.c b/sys/netinet/ipsec_input.c index 0765dac25cd..43bd253b723 100644 --- a/sys/netinet/ipsec_input.c +++ b/sys/netinet/ipsec_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ipsec_input.c,v 1.73 2004/06/21 20:44:54 itojun Exp $ */ +/* $OpenBSD: ipsec_input.c,v 1.74 2004/06/21 23:50:37 tholo Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), * Angelos D. Keromytis (kermit@csd.uch.gr) and @@ -242,11 +242,7 @@ ipsec_common_input(struct mbuf *m, int skip, int protoff, int af, int sproto, /* Register first use, setup expiration timer. */ if (tdbp->tdb_first_use == 0) { - int pri; - - pri = splhigh(); - tdbp->tdb_first_use = time.tv_sec; - splx(pri); + tdbp->tdb_first_use = time_second; tv.tv_usec = 0; @@ -295,7 +291,7 @@ 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; + tdbp->tdb_last_used = time_second; /* Sanity check */ if (m == NULL) { @@ -868,7 +864,7 @@ ipsec_common_ctlinput(int cmd, struct sockaddr *sa, void *v, int proto) /* Store adjusted MTU in tdb */ tdbp->tdb_mtu = mtu; - tdbp->tdb_mtutimeout = time.tv_sec + + tdbp->tdb_mtutimeout = time_second + ip_mtudisc_timeout; } splx(s); |