Skip to content

Commit

Permalink
Small cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomasdezeeuw authored Dec 21, 2022
1 parent 085c9e1 commit 62e2b02
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions src/sys/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -2118,7 +2104,7 @@ impl crate::Socket {
)]
pub fn tclass_v6(&self) -> io::Result<u32> {
unsafe {
getsockopt::<c_int>(self.as_raw(), IPPROTO_IPV6, IPV6_TCLASS)
getsockopt::<c_int>(self.as_raw(), IPPROTO_IPV6, libc::IPV6_TCLASS)
.map(|tclass| tclass as u32)
}
}
Expand Down Expand Up @@ -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) }
}
}

Expand Down

0 comments on commit 62e2b02

Please sign in to comment.