summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDavid Lönnhager <david.l@mullvad.net>2019-12-09 17:34:01 +0100
committerDavid Lönnhager <david.l@mullvad.net>2019-12-17 12:30:15 +0100
commitf5dc93c3fc2e015470681c75c0a6d11c2c0190ef (patch)
tree6fa1d851228bf2f4f3199f9bdc7346ae694ae522
parent9e11671235a1dbb3460a58767f286033f2b9634e (diff)
downloadmullvadvpn-f5dc93c3fc2e015470681c75c0a6d11c2c0190ef.tar.xz
mullvadvpn-f5dc93c3fc2e015470681c75c0a6d11c2c0190ef.zip
Treat zero interval as disabling auto rotation
-rw-r--r--mullvad-daemon/src/wireguard.rs16
1 files changed, 11 insertions, 5 deletions
diff --git a/mullvad-daemon/src/wireguard.rs b/mullvad-daemon/src/wireguard.rs
index 00dd132ad8..884c144113 100644
--- a/mullvad-daemon/src/wireguard.rs
+++ b/mullvad-daemon/src/wireguard.rs
@@ -140,16 +140,22 @@ impl KeyManager {
let remote_clone = tokio_remote.clone();
let daemon_tx_clone = daemon_tx.clone();
+ let abort_scheduler_tx = match automatic_key_rotation {
+ // Interval=0 disables automatic key rotation
+ Some(0) => None,
+ _ => KeyRotationScheduler::new(
+ remote_clone,
+ daemon_tx_clone,
+ automatic_key_rotation,
+ ).ok(),
+ };
+
Self {
daemon_tx,
http_handle,
tokio_remote,
current_job: None,
- abort_scheduler_tx: KeyRotationScheduler::new(
- remote_clone,
- daemon_tx_clone,
- automatic_key_rotation,
- ).ok()
+ abort_scheduler_tx,
}
}