diff options
| author | Jonathan <jonathan@mullvad.net> | 2022-06-13 15:50:43 +0200 |
|---|---|---|
| committer | Jonathan <jonathan@mullvad.net> | 2022-06-13 15:50:43 +0200 |
| commit | 92fa1004440957aa78abc9ca10bfa38a96ce759e (patch) | |
| tree | 13929fd3519959e688d5de38d49a3cabc02718e2 | |
| parent | 68fc78c892a6e25cdb360ce5104d40330add6993 (diff) | |
| parent | 39ef244d82e708039c6d546068a2e7c8de0063a2 (diff) | |
| download | mullvadvpn-92fa1004440957aa78abc9ca10bfa38a96ce759e.tar.xz mullvadvpn-92fa1004440957aa78abc9ca10bfa38a96ce759e.zip | |
Merge branch 'detect-mtu-on-wireguard-bugfix'
| -rw-r--r-- | CHANGELOG.md | 3 | ||||
| -rw-r--r-- | talpid-core/src/routing/linux.rs | 10 |
2 files changed, 10 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index f7684acf14..0dbdf18d11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,9 @@ Line wrap the file at 100 chars. Th ### Added - Add option to filter relays by ownership in the desktop apps. +#### Linux +- Automatically attempt to detect and set the correct MTU for Wireguard tunnels. + ### Changed - Display consistent colors regardless of monitor color profile. diff --git a/talpid-core/src/routing/linux.rs b/talpid-core/src/routing/linux.rs index e4fd6cc265..2a34de42cd 100644 --- a/talpid-core/src/routing/linux.rs +++ b/talpid-core/src/routing/linux.rs @@ -113,6 +113,9 @@ pub enum Error { #[error(display = "No netlink response for route query")] NoRouteError, + #[error(display = "Route node was malformed")] + InvalidRouteNode, + #[error(display = "No link found")] LinkNotFoundError, @@ -738,7 +741,7 @@ impl RouteManagerImpl { Some(route) => { let node = route.get_node(); match (node.get_device(), node.get_address()) { - (Some(device), None) => { + (Some(device), _) => { let mtu = self.get_device_mtu(device.to_string()).await?; if mtu != STANDARD_MTU { log::info!( @@ -751,8 +754,9 @@ impl RouteManagerImpl { return Ok(mtu); } (None, Some(address)) => attempted_ip = address, - _ => { - panic!("Route must contain either an IP or a device."); + (None, None) => { + log::error!("Route contains an invalid node which lacks both a device and an address"); + return Err(Error::InvalidRouteNode); } } } |
