Skip to content

Commit

Permalink
Ensure tunnel is running after updating wireguard config
Browse files Browse the repository at this point in the history
  • Loading branch information
Rawa committed Jan 24, 2025
1 parent a1571df commit 3b3c587
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions talpid-wireguard/src/wireguard_go/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,16 @@ impl WgGoTunnel {
}
WgGoTunnel::Singlehop(mut state) => {
state.set_config(config.clone())?;
Ok(WgGoTunnel::Singlehop(state))
// HACK: Check if the tunnel is working by sending a ping in the tunnel.
let new_state = WgGoTunnel::Singlehop(state);
new_state.ensure_tunnel_is_running().await?;
Ok(new_state)
}
WgGoTunnel::Multihop(mut state) => {
state.set_config(config.clone())?;
Ok(WgGoTunnel::Multihop(state))
let new_state = WgGoTunnel::Multihop(state);
new_state.ensure_tunnel_is_running().await?;
Ok(new_state)
}
}
}
Expand Down

0 comments on commit 3b3c587

Please sign in to comment.