diff options
author | 2001-12-12 04:46:42 +0000 | |
---|---|---|
committer | 2001-12-12 04:46:42 +0000 | |
commit | 8b94f8b3129428c1033267e610d2f12c89143ae6 (patch) | |
tree | e1a32dd7d0a4d816ac90516d93e907ccb122fa6c | |
parent | Fix the double occurence of the DFE530TX, and update Promise cards description (diff) | |
download | wireguard-openbsd-8b94f8b3129428c1033267e610d2f12c89143ae6.tar.xz wireguard-openbsd-8b94f8b3129428c1033267e610d2f12c89143ae6.zip |
Remember to add the current time...problem noticed by ho@
-rw-r--r-- | sys/net/pfkeyv2_convert.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/net/pfkeyv2_convert.c b/sys/net/pfkeyv2_convert.c index db1e30c76d8..e33642b8590 100644 --- a/sys/net/pfkeyv2_convert.c +++ b/sys/net/pfkeyv2_convert.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfkeyv2_convert.c,v 1.6 2001/12/06 22:52:10 angelos Exp $ */ +/* $OpenBSD: pfkeyv2_convert.c,v 1.7 2001/12/12 04:46:42 angelos Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@keromytis.org) * @@ -243,12 +243,14 @@ void import_lifetime(struct tdb *tdb, struct sadb_lifetime *sadb_lifetime, int type) { struct timeval tv; + int s; if (!sadb_lifetime) return; - tv.tv_sec = 0; - tv.tv_usec = 0; + s = splhigh(); + tv = time; + splx(s); switch (type) { case PFKEYV2_LIFETIME_HARD: @@ -267,7 +269,7 @@ import_lifetime(struct tdb *tdb, struct sadb_lifetime *sadb_lifetime, int type) if ((tdb->tdb_exp_timeout = sadb_lifetime->sadb_lifetime_addtime) != 0) { tdb->tdb_flags |= TDBF_TIMER; - tv.tv_sec = tdb->tdb_exp_timeout; + tv.tv_sec += tdb->tdb_exp_timeout; timeout_add(&tdb->tdb_timer_tmo, hzto(&tv)); } else @@ -296,7 +298,7 @@ import_lifetime(struct tdb *tdb, struct sadb_lifetime *sadb_lifetime, int type) if ((tdb->tdb_soft_timeout = sadb_lifetime->sadb_lifetime_addtime) != 0) { tdb->tdb_flags |= TDBF_SOFT_TIMER; - tv.tv_sec = tdb->tdb_soft_timeout; + tv.tv_sec += tdb->tdb_soft_timeout; timeout_add(&tdb->tdb_stimer_tmo, hzto(&tv)); } else |