diff options
| -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); } } } |
