diff options
author | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2019-09-22 21:35:06 +0200 |
---|---|---|
committer | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2019-09-22 21:35:06 +0200 |
commit | 794933d6ddda5f45c240b66998b636bdfc484098 (patch) | |
tree | 05fcb5f0e192e37f62571e9bbd3bda2e1376f848 /src/handshake/peer.rs | |
parent | Added zero_key to peer (diff) | |
download | wireguard-rs-794933d6ddda5f45c240b66998b636bdfc484098.tar.xz wireguard-rs-794933d6ddda5f45c240b66998b636bdfc484098.zip |
Work on peer timers
Diffstat (limited to 'src/handshake/peer.rs')
-rw-r--r-- | src/handshake/peer.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/handshake/peer.rs b/src/handshake/peer.rs index 6a85cee..c9e1c40 100644 --- a/src/handshake/peer.rs +++ b/src/handshake/peer.rs @@ -1,4 +1,3 @@ -use lazy_static::lazy_static; use spin::Mutex; use std::mem; @@ -18,9 +17,7 @@ use super::macs; use super::timestamp; use super::types::*; -lazy_static! { - pub static ref TIME_BETWEEN_INITIATIONS: Duration = Duration::from_millis(20); -} +const TIME_BETWEEN_INITIATIONS: Duration = Duration::from_millis(20); /* Represents the recomputation and state of a peer. * @@ -123,7 +120,7 @@ impl Peer { // check flood attack match *last_initiation_consumption { Some(last) => { - if last.elapsed() < *TIME_BETWEEN_INITIATIONS { + if last.elapsed() < TIME_BETWEEN_INITIATIONS { return Err(HandshakeError::InitiationFlood); } } |