From 90335f0ad263a2f3eda26fafa37463973037af2f Mon Sep 17 00:00:00 2001 From: hikaricai <13061980190@163.com> Date: Fri, 23 Aug 2024 23:41:00 +0800 Subject: [PATCH] fix raw_socket on macos --- src/phy/raw_socket.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/phy/raw_socket.rs b/src/phy/raw_socket.rs index 0cb7752d9..9445210ba 100644 --- a/src/phy/raw_socket.rs +++ b/src/phy/raw_socket.rs @@ -43,7 +43,10 @@ impl RawSocket { mtu += 2; } - #[cfg(feature = "medium-ethernet")] + #[cfg(all( + feature = "medium-ethernet", + not(any(target_os = "macos", target_os = "openbsd")) + ))] if medium == Medium::Ethernet { // SIOCGIFMTU returns the IP MTU (typically 1500 bytes.) // smoltcp counts the entire Ethernet packet in the MTU, so add the Ethernet header size to it.