Skip to content

Commit f46381e

Browse files
committed
temp
1 parent e2711e7 commit f46381e

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

Cargo.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

talpid-wireguard/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1003,7 +1003,7 @@ impl WireguardMonitor {
10031003
///
10041004
/// The detection works by sending evenly spread out range of pings between 576 and the given
10051005
/// current tunnel MTU, and returning the maximum packet size that was returned within a timeout.
1006-
#[cfg(any(target_os = "linux", windows))]
1006+
#[cfg(any(target_os = "linux", windows, target_os = "macos"))]
10071007
async fn auto_mtu_detection(
10081008
gateway: std::net::Ipv4Addr,
10091009
#[cfg(any(target_os = "macos", target_os = "linux"))] iface_name: String,
@@ -1080,7 +1080,7 @@ async fn auto_mtu_detection(
10801080

10811081
/// Creates a linear spacing of MTU values with the given step size. Always includes the given end
10821082
/// points.
1083-
#[cfg(any(target_os = "linux", windows))]
1083+
#[cfg(any(target_os = "linux", windows, target_os = "macos"))]
10841084
fn mtu_spacing(mtu_min: u16, mtu_max: u16, step_size: u16) -> Vec<u16> {
10851085
assert!(mtu_min < mtu_max);
10861086
assert!(step_size < mtu_max);

talpid-wireguard/src/unix.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ pub fn set_mtu(interface_name: &str, mtu: u16) -> Result<(), io::Error> {
3232
};
3333
ifr.ifr_ifru.ifru_mtu = mtu as i32;
3434

35-
if unsafe { libc::ioctl(sock.as_raw_fd(), libc::SIOCSIFMTU, &ifr) } < 0 {
35+
const SIOCSIFMTU: u64 = 0x80206934;
36+
if unsafe { libc::ioctl(sock.as_raw_fd(), SIOCSIFMTU, &ifr) } < 0 {
3637
let e = std::io::Error::last_os_error();
3738
log::error!("{}", e.display_chain_with_msg("SIOCSIFMTU failed"));
3839
return Err(e);

0 commit comments

Comments
 (0)