Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion boringtun/src/noise/timers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

use super::errors::WireGuardError;
use crate::noise::{Tunn, TunnResult, N_SESSIONS};
use std::iter;
use std::ops::{Index, IndexMut};

use rand::Rng;
Expand Down Expand Up @@ -376,7 +377,10 @@ impl Tunn {
///
/// If this returns `None`, you may call it at your usual desired precision (usually once a second is enough).
pub fn next_timer_update(&self) -> Option<Instant> {
self.timers.send_handshake_at
iter::empty()
.chain(self.timers.send_handshake_at)
.chain(self.timers.want_passive_keepalive_at)
.min()
}

#[deprecated(note = "Prefer `Tunn::time_since_last_handshake_at` to avoid time-impurity")]
Expand Down
Loading