summaryrefslogtreecommitdiff
path: root/src/sys/socket/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/sys/socket/mod.rs')
-rw-r--r--src/sys/socket/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sys/socket/mod.rs b/src/sys/socket/mod.rs
index 6ab1684a..e0f957d8 100644
--- a/src/sys/socket/mod.rs
+++ b/src/sys/socket/mod.rs
@@ -227,7 +227,7 @@ impl<'a> Iterator for CmsgIterator<'a> {
if self.buf.len() < sizeof_cmsghdr {
return None;
}
- let cmsg: &cmsghdr = unsafe { mem::transmute(self.buf.as_ptr()) };
+ let cmsg: &'a cmsghdr = unsafe { &*(self.buf.as_ptr() as *const cmsghdr) };
// This check is only in the glibc implementation of CMSG_NXTHDR
// (although it claims the kernel header checks this), but such