From 62e2b02472bf949bdda7201cc8e08d9dd0994211 Mon Sep 17 00:00:00 2001 From: Thomas de Zeeuw Date: Wed, 21 Dec 2022 12:59:58 +0000 Subject: [PATCH] Small cleanup --- src/sys/unix.rs | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/src/sys/unix.rs b/src/sys/unix.rs index 26265ac1..fdb94592 100644 --- a/src/sys/unix.rs +++ b/src/sys/unix.rs @@ -86,20 +86,6 @@ pub(crate) use libc::{MSG_TRUNC, SO_OOBINLINE}; target_os = "solaris", )))] pub(crate) use libc::IPV6_RECVTCLASS; -#[cfg(all( - feature = "all", - any( - target_os = "android", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "linux", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd" - ) -))] -pub(crate) use libc::IPV6_TCLASS; #[cfg(all(feature = "all", not(target_os = "redox")))] pub(crate) use libc::IP_HDRINCL; #[cfg(not(any( @@ -2118,7 +2104,7 @@ impl crate::Socket { )] pub fn tclass_v6(&self) -> io::Result { unsafe { - getsockopt::(self.as_raw(), IPPROTO_IPV6, IPV6_TCLASS) + getsockopt::(self.as_raw(), IPPROTO_IPV6, libc::IPV6_TCLASS) .map(|tclass| tclass as u32) } } @@ -2157,7 +2143,7 @@ impl crate::Socket { ))) )] pub fn set_tclass_v6(&self, tclass: u32) -> io::Result<()> { - unsafe { setsockopt(self.as_raw(), IPPROTO_IPV6, IPV6_TCLASS, tclass as c_int) } + unsafe { setsockopt(self.as_raw(), IPPROTO_IPV6, libc::IPV6_TCLASS, tclass as c_int) } } }