Skip to content

Commit

Permalink
use the as_raw method
Browse files Browse the repository at this point in the history
  • Loading branch information
aym-v authored and Thomasdezeeuw committed Jul 10, 2021
1 parent a7c82f7 commit 1c67209
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1182,7 +1182,7 @@ impl Socket {
target_os = "illumos",
)))]
pub fn set_tos(&self, tos: u32) -> io::Result<()> {
unsafe { setsockopt(self.inner, sys::IPPROTO_IP, sys::IP_TOS, tos as c_int) }
unsafe { setsockopt(self.as_raw(), sys::IPPROTO_IP, sys::IP_TOS, tos as c_int) }
}

/// Get the value of the `IP_TOS` option for this socket.
Expand All @@ -1200,7 +1200,7 @@ impl Socket {
)))]
pub fn tos(&self) -> io::Result<u32> {
unsafe {
getsockopt::<c_int>(self.inner, sys::IPPROTO_IP, sys::IP_TOS).map(|tos| tos as u32)
getsockopt::<c_int>(self.as_raw(), sys::IPPROTO_IP, sys::IP_TOS).map(|tos| tos as u32)
}
}
}
Expand Down

0 comments on commit 1c67209

Please sign in to comment.