Skip to content

Commit

Permalink
Expand TCP / UDP binding interface to android. (#832)
Browse files Browse the repository at this point in the history
  • Loading branch information
DariusIMP authored Mar 18, 2024
1 parent 65f06fd commit 0bdd136
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions commons/zenoh-util/src/std_only/net/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,15 +423,15 @@ pub fn get_ipv6_ipaddrs(interface: Option<&str>) -> Vec<IpAddr> {
.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()))?;
}
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()))?;
Expand Down

0 comments on commit 0bdd136

Please sign in to comment.