Skip to content

Commit 0f2f1f8

Browse files
committed
Do not drop connection checker when updating tun without enabling or
disabling multihop
1 parent a59360c commit 0f2f1f8

File tree

1 file changed

+8
-5
lines changed
  • talpid-wireguard/src/wireguard_go

1 file changed

+8
-5
lines changed

talpid-wireguard/src/wireguard_go/mod.rs

+8-5
Original file line numberDiff line numberDiff line change
@@ -106,17 +106,17 @@ impl WgGoTunnel {
106106
}
107107
}
108108

109-
pub fn set_config(mut self, config: &Config) -> Result<Self> {
110-
let connectivity_checker = self
111-
.take_checker()
112-
.expect("connectivity checker unexpectedly dropped");
109+
pub fn set_config(self, config: &Config) -> Result<Self> {
113110
let state = self.as_state();
114111
let log_path = state._logging_context.path.clone();
115112
let tun_provider = Arc::clone(&state.tun_provider);
116113
let routes = config.get_tunnel_destinations();
117114

118115
match self {
119-
WgGoTunnel::Multihop(state) if !config.is_multihop() => {
116+
WgGoTunnel::Multihop(mut state) if !config.is_multihop() => {
117+
let connectivity_checker = self
118+
.take_checker()
119+
.expect("connectivity checker unexpectedly dropped");
120120
state.stop()?;
121121
Self::start_tunnel(
122122
config,
@@ -127,6 +127,9 @@ impl WgGoTunnel {
127127
)
128128
}
129129
WgGoTunnel::Singlehop(state) if config.is_multihop() => {
130+
let connectivity_checker = self
131+
.take_checker()
132+
.expect("connectivity checker unexpectedly dropped");
130133
state.stop()?;
131134
Self::start_multihop_tunnel(
132135
config,

0 commit comments

Comments
 (0)