From 0bdd13606f639ca273baf7640dd6773fa021a1db Mon Sep 17 00:00:00 2001 From: Darius Maitia Date: Mon, 18 Mar 2024 11:01:15 +0100 Subject: [PATCH] Expand TCP / UDP binding interface to android. (#832) --- commons/zenoh-util/src/std_only/net/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commons/zenoh-util/src/std_only/net/mod.rs b/commons/zenoh-util/src/std_only/net/mod.rs index 8ec0ed03a1..15ea8fc99d 100644 --- a/commons/zenoh-util/src/std_only/net/mod.rs +++ b/commons/zenoh-util/src/std_only/net/mod.rs @@ -423,7 +423,7 @@ pub fn get_ipv6_ipaddrs(interface: Option<&str>) -> Vec { .collect() } -#[cfg(target_os = "linux")] +#[cfg(any(target_os = "linux", target_os = "android"))] pub fn set_bind_to_device_tcp_socket(socket: &TcpSocket, iface: Option<&str>) -> ZResult<()> { if let Some(iface) = iface { socket.bind_device(Some(iface.as_bytes()))?; @@ -431,7 +431,7 @@ pub fn set_bind_to_device_tcp_socket(socket: &TcpSocket, iface: Option<&str>) -> Ok(()) } -#[cfg(target_os = "linux")] +#[cfg(any(target_os = "linux", target_os = "android"))] pub fn set_bind_to_device_udp_socket(socket: &UdpSocket, iface: Option<&str>) -> ZResult<()> { if let Some(iface) = iface { socket.bind_device(Some(iface.as_bytes()))?;