summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDavid Lönnhager <david.l@mullvad.net>2025-03-19 09:57:22 +0100
committerDavid Lönnhager <david.l@mullvad.net>2025-03-19 09:57:22 +0100
commitf8e58ab81e97ce5099fe6cd7d463f36604ae6bd8 (patch)
tree01a4f83b1eddeef2937087a2145ceaa387a531a1
parent22fc75dc527d1510874f7253b728a068426f6beb (diff)
parent58bfb177a31591765fa2ce70a4007363f842dab5 (diff)
downloadmullvadvpn-f8e58ab81e97ce5099fe6cd7d463f36604ae6bd8.tar.xz
mullvadvpn-f8e58ab81e97ce5099fe6cd7d463f36604ae6bd8.zip
Merge branch 'wg-fix-ipv6-mtu'
-rw-r--r--CHANGELOG.md3
-rw-r--r--talpid-openvpn/src/wintun.rs2
-rw-r--r--talpid-tunnel/src/windows.rs13
-rw-r--r--talpid-wireguard/src/wireguard_go/mod.rs3
-rw-r--r--talpid-wireguard/src/wireguard_nt/mod.rs8
5 files changed, 22 insertions, 7 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 44402cdbad..72e2327d50 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -28,6 +28,9 @@ Line wrap the file at 100 chars. Th
### Fixed
- Fix `mullvad-cli` panicking if it tried to write to a closed pipe on Linux and macOS.
+#### Windows
+- Fix error setting up tunnel when MTU was incorrectly set to a value below 1280 for IPv6.
+
## [2025.5-beta1] - 2025-03-11
### Added
diff --git a/talpid-openvpn/src/wintun.rs b/talpid-openvpn/src/wintun.rs
index f8592ef94c..a77ce81e02 100644
--- a/talpid-openvpn/src/wintun.rs
+++ b/talpid-openvpn/src/wintun.rs
@@ -98,7 +98,7 @@ impl WintunAdapter {
pub fn prepare_interface(&self) {
if let Err(error) =
- talpid_tunnel::network_interface::initialize_interfaces(self.luid(), None)
+ talpid_tunnel::network_interface::initialize_interfaces(self.luid(), None, None)
{
log::error!(
"{}",
diff --git a/talpid-tunnel/src/windows.rs b/talpid-tunnel/src/windows.rs
index bc5fffb3f0..109e6a9ae1 100644
--- a/talpid-tunnel/src/windows.rs
+++ b/talpid-tunnel/src/windows.rs
@@ -7,8 +7,15 @@ use windows_sys::Win32::{
/// Sets MTU, metric, and disables unnecessary features for the IP interfaces
/// on the specified network interface (identified by `luid`).
-pub fn initialize_interfaces(luid: NET_LUID_LH, mtu: Option<u32>) -> io::Result<()> {
- for family in &[AddressFamily::Ipv4, AddressFamily::Ipv6] {
+pub fn initialize_interfaces(
+ luid: NET_LUID_LH,
+ ipv4_mtu: Option<u32>,
+ ipv6_mtu: Option<u32>,
+) -> io::Result<()> {
+ for (family, mtu) in &[
+ (AddressFamily::Ipv4, ipv4_mtu),
+ (AddressFamily::Ipv6, ipv6_mtu),
+ ] {
let mut row = match get_ip_interface_entry(*family, &luid) {
Ok(row) => row,
Err(error) if error.raw_os_error() == Some(ERROR_NOT_FOUND as i32) => continue,
@@ -16,7 +23,7 @@ pub fn initialize_interfaces(luid: NET_LUID_LH, mtu: Option<u32>) -> io::Result<
};
if let Some(mtu) = mtu {
- row.NlMtu = mtu;
+ row.NlMtu = *mtu;
}
// Disable DAD, DHCP, and router discovery
diff --git a/talpid-wireguard/src/wireguard_go/mod.rs b/talpid-wireguard/src/wireguard_go/mod.rs
index 0289831172..2f315c82cb 100644
--- a/talpid-wireguard/src/wireguard_go/mod.rs
+++ b/talpid-wireguard/src/wireguard_go/mod.rs
@@ -311,7 +311,8 @@ impl WgGoTunnel {
.map_err(|e| BoxedError::new(TunnelError::SetupIpInterfaces(e)))?;
log::debug!("Waiting for tunnel IP interfaces: Done");
- if let Err(error) = talpid_tunnel::network_interface::initialize_interfaces(luid, None)
+ if let Err(error) =
+ talpid_tunnel::network_interface::initialize_interfaces(luid, None, None)
{
log::error!(
"{}",
diff --git a/talpid-wireguard/src/wireguard_nt/mod.rs b/talpid-wireguard/src/wireguard_nt/mod.rs
index ff5b082490..baac2ddd69 100644
--- a/talpid-wireguard/src/wireguard_nt/mod.rs
+++ b/talpid-wireguard/src/wireguard_nt/mod.rs
@@ -543,8 +543,12 @@ async fn setup_ip_listener(device: Arc<WgNtAdapter>, mtu: u32, has_ipv6: bool) -
.map_err(Error::IpInterfaces)?;
log::debug!("Waiting for tunnel IP interfaces: Done");
- talpid_tunnel::network_interface::initialize_interfaces(luid, Some(mtu))
- .map_err(Error::SetTunnelMtu)?;
+ talpid_tunnel::network_interface::initialize_interfaces(
+ luid,
+ Some(mtu),
+ has_ipv6.then_some(mtu),
+ )
+ .map_err(Error::SetTunnelMtu)?;
device
.set_state(WgAdapterState::Up)