Skip to content

Commit

Permalink
Make internal only on ApplePlatforms
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasz-grz committed Jan 23, 2025
1 parent 724ca62 commit fe5726a
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions crates/telio-pinger/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,23 @@ impl Pinger {
) -> std::io::Result<Self> {
let client_v6 = if ipv6 {
let client_v6 = Arc::new(Self::build_client(ICMP::V6)?);
telio_log_trace!("Making pinger IPv6 socket internal");
socket_pool.make_internal(client_v6.get_socket().get_native_sock())?;
#[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))]
{
telio_log_debug!("Making pinger IPv6 socket internal");
socket_pool.make_internal(client_v6.get_socket().get_native_sock())?;
}
Some(client_v6)
} else {
None
};

let client_v4 = Arc::new(Self::build_client(ICMP::V4)?);
telio_log_trace!("Making pinger IPv4 socket internal");
socket_pool.make_internal(client_v4.get_socket().get_native_sock())?;

#[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))]
{
telio_log_debug!("Making pinger IPv4 socket internal");
socket_pool.make_internal(client_v4.get_socket().get_native_sock())?;
}
Ok(Self {
client_v4,
client_v6,
Expand Down

0 comments on commit fe5726a

Please sign in to comment.