Skip to content

Commit 973899b

Browse files
committed
Add const DEFAULT_MTU back
1 parent 82f46bd commit 973899b

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

@@ -137,13 +145,7 @@ impl TunnelMonitor {
137145
+ Clone
138146
+ 'static,
139147
{
140-
let default_mtu = if cfg!(target_os = "android") {
141-
// Set the MTU to the lowest possible whilst still allowing for IPv6 to help
142-
// with wireless carriers that do a lot of encapsulation.
143-
1280
144-
} else {
145-
1380
146-
};
148+
let default_mtu = DEFAULT_MTU;
147149

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

0 commit comments

Comments
 (0)