--- a/src/os/unix/udsocket/socket.rs +++ b/src/os/unix/udsocket/socket.rs @@ -293,7 +293,7 @@ let mut addr_buf_staging = unsafe { zeroed::() }; // It's a void* so the doublecast is mandatory hdr.msg_name = &mut addr_buf_staging as *mut _ as *mut _; - hdr.msg_namelen = size_of_val(&addr_buf_staging).try_to::().unwrap(); + hdr.msg_namelen = size_of_val(&addr_buf_staging).try_to::().unwrap(); fill_out_msghdr_r(&mut hdr, bufs, abuf.as_mut())?; let (success, bytes_read) = unsafe { let result = libc::recvmsg(self.as_raw_fd(), &mut hdr as *mut _, 0); --- a/src/os/unix/udsocket/c_wrappers.rs +++ b/src/os/unix/udsocket/c_wrappers.rs @@ -51,7 +51,7 @@ // Double cast because you cannot cast a reference to a pointer of arbitrary type // but you can cast any narrow pointer to any other narrow pointer addr as *const _ as *const sockaddr, - size_of::() as u32, + size_of::() as libc::socklen_t, ) != -1 }; if success { @@ -70,7 +70,7 @@ libc::connect( fd.0, addr as *const _ as *const _, - size_of::() as u32, + size_of::() as libc::socklen_t, ) != -1 }; if success { @@ -101,7 +101,7 @@ SOL_SOCKET, SO_PASSCRED, &passcred as *const _ as *const _, - size_of_val(&passcred) as u32, + size_of_val(&passcred) as libc::socklen_t, ) != -1 }; if success {