summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLinus Färnstrand <linus@mullvad.net>2017-06-14 10:26:32 +0200
committerLinus Färnstrand <linus@mullvad.net>2017-06-14 12:15:29 +0200
commitec591107a6b0105adf4c16720ae93434dc4b7cde (patch)
tree099f87de945aead79dae49f9578a96e33b3918cc
parent13c50539153381845f44828dc349384cfc5621be (diff)
downloadmullvadvpn-ec591107a6b0105adf4c16720ae93434dc4b7cde.tar.xz
mullvadvpn-ec591107a6b0105adf4c16720ae93434dc4b7cde.zip
Stop daemon from killing OpenVPN multiple times
-rw-r--r--mullvad_daemon/src/main.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/mullvad_daemon/src/main.rs b/mullvad_daemon/src/main.rs
index 26fa8dd5aa..d7be4d4e51 100644
--- a/mullvad_daemon/src/main.rs
+++ b/mullvad_daemon/src/main.rs
@@ -236,8 +236,9 @@ impl Daemon {
}
}
TargetState::Unsecured => {
- if let Some(ref close_handle) = self.tunnel_close_handle {
+ if let Some(close_handle) = self.tunnel_close_handle.take() {
debug!("Triggering tunnel stop from management interface event");
+ // This close operation will block until the tunnel is dead.
close_handle
.close()
.chain_err(|| ErrorKind::TunnelError("Unable to kill tunnel"))?;