Skip to content

Commit 5e91463

Browse files
committed
apply suggestion
1 parent 63a10d6 commit 5e91463

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/sys/socket/mod.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,17 @@ impl SockProtocol {
249249
pub const KextEvent: SockProtocol = SockProtocol::Icmp; // Matches libc::SYSPROTO_EVENT
250250

251251
/// Packet filter on IPv4 traffic
252-
/// NOTE: placed here due to conflict (little endian arch) with SockProtocol::NetLinkISCI
252+
// NOTE: placed here due to conflict (little endian arch) with SockProtocol::NetLinkISCI
253253
#[cfg(linux_android)]
254254
#[allow(non_upper_case_globals)]
255+
#[cfg(target_endian = "little"])]
255256
pub const EthIp: SockProtocol = unsafe { std::mem::transmute::<i32, SockProtocol>((libc::ETH_P_IP as u16).to_be() as i32) };
257+
258+
/// Packet filter on IPv4 traffic
259+
#[cfg(linux_android)]
260+
#[allow(non_upper_case_globals)]
261+
#[cfg(target_endian = "big"])]
262+
EthIp = (libc::ETH_P_IP as u16).to_be() as i32;
256263
}
257264
#[cfg(linux_android)]
258265
libc_bitflags! {

0 commit comments

Comments
 (0)