Skip to content

Commit 45c012f

Browse files
committed
Add const DEFAULT_MTU back
1 parent 2553725 commit 45c012f

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

talpid-core/src/tunnel/mod.rs

+9-7
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ use talpid_wireguard;
1717
const OPENVPN_LOG_FILENAME: &str = "openvpn.log";
1818
const WIREGUARD_LOG_FILENAME: &str = "wireguard.log";
1919

20+
/// Set the MTU to the lowest possible whilst still allowing for IPv6 to help with wireless
21+
/// carriers that do a lot of encapsulation.
22+
const DEFAULT_MTU: u16 = if cfg!(target_os = "android") {
23+
1280
24+
} else {
25+
1380
26+
};
27+
2028
/// Results from operations in the tunnel module.
2129
pub type Result<T> = std::result::Result<T, Error>;
2230

@@ -154,13 +162,7 @@ impl TunnelMonitor {
154162
+ Clone
155163
+ 'static,
156164
{
157-
let default_mtu = if cfg!(target_os = "android") {
158-
// Set the MTU to the lowest possible whilst still allowing for IPv6 to help
159-
// with wireless carriers that do a lot of encapsulation.
160-
1280
161-
} else {
162-
1380
163-
};
165+
let default_mtu = DEFAULT_MTU;
164166

165167
#[cfg(any(target_os = "linux", target_os = "windows"))]
166168
// Detects the MTU of the device, calculates what the virtual device MTU should be use that

0 commit comments

Comments
 (0)