diff options
| author | Sebastian Holmin <sebastian.holmin@mullvad.net> | 2024-02-09 16:50:40 +0100 |
|---|---|---|
| committer | Sebastian Holmin <sebastian.holmin@mullvad.net> | 2024-02-13 11:41:06 +0100 |
| commit | 30e87d5e294f0756e548e2fdcc64a8428970824f (patch) | |
| tree | 6575ebb75342f83dedab62976803edb211db9687 | |
| parent | 8e65171d273c433cc63b8a677463ac976306f91a (diff) | |
| download | mullvadvpn-mtu-detection-android.tar.xz mullvadvpn-mtu-detection-android.zip | |
Fix `SIOCSIFMTU` typemtu-detection-android
| -rw-r--r-- | talpid-wireguard/src/unix.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/talpid-wireguard/src/unix.rs b/talpid-wireguard/src/unix.rs index 2c35edd73f..01c6ab83c7 100644 --- a/talpid-wireguard/src/unix.rs +++ b/talpid-wireguard/src/unix.rs @@ -4,9 +4,11 @@ use socket2::Domain; use talpid_types::ErrorExt; #[cfg(target_os = "macos")] -const SIOCSIFMTU: u64 = 0x80206934; -#[cfg(not(target_os = "macos"))] -const SIOCSIFMTU: u64 = libc::SIOCSIFMTU; +const SIOCSIFMTU: libc::c_ulong = 0x80206934; +#[cfg(target_os = "linux")] +const SIOCSIFMTU: libc::c_ulong = libc::SIOCSIFMTU; +#[cfg(target_os = "android")] +const SIOCSIFMTU: libc::c_int = libc::SIOCSIFMTU as libc::c_int; pub fn set_mtu(interface_name: &str, mtu: u16) -> Result<(), io::Error> { debug_assert_ne!( |
