From 5e9146363af89654832956b54f4b3c8ea8bf33df Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sun, 12 Jan 2025 06:00:13 +0000 Subject: [PATCH] apply suggestion --- src/sys/socket/mod.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/sys/socket/mod.rs b/src/sys/socket/mod.rs index fe0094b1bb..a82c043752 100644 --- a/src/sys/socket/mod.rs +++ b/src/sys/socket/mod.rs @@ -249,10 +249,17 @@ impl SockProtocol { pub const KextEvent: SockProtocol = SockProtocol::Icmp; // Matches libc::SYSPROTO_EVENT /// Packet filter on IPv4 traffic - /// NOTE: placed here due to conflict (little endian arch) with SockProtocol::NetLinkISCI + // NOTE: placed here due to conflict (little endian arch) with SockProtocol::NetLinkISCI #[cfg(linux_android)] #[allow(non_upper_case_globals)] + #[cfg(target_endian = "little"])] pub const EthIp: SockProtocol = unsafe { std::mem::transmute::((libc::ETH_P_IP as u16).to_be() as i32) }; + + /// Packet filter on IPv4 traffic + #[cfg(linux_android)] + #[allow(non_upper_case_globals)] + #[cfg(target_endian = "big"])] + EthIp = (libc::ETH_P_IP as u16).to_be() as i32; } #[cfg(linux_android)] libc_bitflags! {