diff options
author | Jake McGinty <me@jake.su> | 2018-02-23 16:17:19 +0000 |
---|---|---|
committer | Jake McGinty <me@jake.su> | 2018-02-23 16:18:22 +0000 |
commit | 5b4903637f2cd576f71c88e6359cc5cf12073351 (patch) | |
tree | e557a05e774b294b298b322c8df74c4c341ab8ff /src/time.rs | |
parent | refactor timestamp code a bit (diff) | |
download | wireguard-rs-5b4903637f2cd576f71c88e6359cc5cf12073351.tar.xz wireguard-rs-5b4903637f2cd576f71c88e6359cc5cf12073351.zip |
make passive keepalive protocol-abiding
Diffstat (limited to 'src/time.rs')
-rw-r--r-- | src/time.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/time.rs b/src/time.rs index 6261573..9653965 100644 --- a/src/time.rs +++ b/src/time.rs @@ -1,7 +1,6 @@ use byteorder::{ByteOrder, BigEndian}; use std::ops::Deref; use std::time::{Duration, Instant, SystemTime, UNIX_EPOCH}; -use std::u64; const TAI64N_BASE: i64 = 4611686018427387914; @@ -36,7 +35,7 @@ impl From<[u8; 12]> for Tai64n { } lazy_static! { - pub static ref FOREVER: Duration = Duration::from_secs(u64::MAX); + pub static ref FOREVER: Duration = SystemTime::now().duration_since(UNIX_EPOCH).unwrap(); pub static ref FOREVER_AGO: Instant = Instant::now() - *FOREVER; } |