Skip to content

Commit 9a7b5b2

Browse files
committed
apply suggestion
1 parent 63a10d6 commit 9a7b5b2

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+
pub const EthIp: i32 = (libc::ETH_P_IP as u16).to_be() as i32;
256263
}
257264
#[cfg(linux_android)]
258265
libc_bitflags! {

0 commit comments

Comments
 (0)