diff options
| author | David Lönnhager <david.l@mullvad.net> | 2026-04-22 13:15:54 +0200 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2026-04-22 13:15:54 +0200 |
| commit | 0e13ae57274fa9fd6a83e971b5b9358a925080a5 (patch) | |
| tree | b631026b1f891a488017cd4379a8f380e8704fc5 | |
| parent | ef6b61a78c2f8461578c9dcef9592b4580eb9ff9 (diff) | |
| parent | 7ba25423ef120c033b403f655cf6509ac4d158da (diff) | |
| download | mullvadvpn-0e13ae57274fa9fd6a83e971b5b9358a925080a5.tar.xz mullvadvpn-0e13ae57274fa9fd6a83e971b5b9358a925080a5.zip | |
Merge branch 'improve-win-got-connect'
| -rw-r--r-- | talpid-tunnel/src/tun_provider/windows.rs | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/talpid-tunnel/src/tun_provider/windows.rs b/talpid-tunnel/src/tun_provider/windows.rs index 4be38b0877..e2b6ae3e1a 100644 --- a/talpid-tunnel/src/tun_provider/windows.rs +++ b/talpid-tunnel/src/tun_provider/windows.rs @@ -50,13 +50,6 @@ impl WindowsTunProvider { /// Open a tunnel using the current tunnel config. pub fn open_tun(&mut self) -> Result<WindowsTun, Error> { - let (first_addr, remaining_addrs) = self - .config - .addresses - .split_first() - .map(|(first, rest)| (Some(first), rest)) - .unwrap_or((None, &[])); - let mut tunnel_device = { let mut builder = TunnelDeviceBuilder::default(); @@ -65,12 +58,6 @@ impl WindowsTunProvider { // routes the highest possible priority. builder.config.metric(1); - // TODO: have tun either not use netsh or not set any default address at all - // TODO: tun can only set a single address - if let Some(addr) = first_addr { - builder.config.address(*addr); - } - /// Tunnel adapter name const ADAPTER_NAME: &str = "Mullvad"; /// Tunnel adapter GUID. @@ -93,7 +80,9 @@ impl WindowsTunProvider { builder.create()? }; - for ip in remaining_addrs { + // TODO: `tun` currently cannot handle IPv6 without using netsh, + // so we add IPs ourselves. + for ip in &self.config.addresses { tunnel_device.set_ip(*ip)?; } |
