diff --git a/CHANGELOG.md b/CHANGELOG.md index 36b528ca91..bc163ca78c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,6 +55,8 @@ This project adheres to [Semantic Versioning](http://semver.org/). # Fixed - Fix compilation and tests for OpenBSD targets ([#688](https://github.com/nix-rust/nix/pull/688)) +- Fixed receiving multiple File Descriptors over a Unix Socket + ([#473](https://github.com/nix-rust/nix/pull/473)) # Removed - The syscall module has been removed. This only exposed enough functionality for diff --git a/src/sys/socket/mod.rs b/src/sys/socket/mod.rs index eccd5e2dc8..5e9a835277 100644 --- a/src/sys/socket/mod.rs +++ b/src/sys/socket/mod.rs @@ -275,7 +275,7 @@ impl<'a> Iterator for CmsgIterator<'a> { (libc::SOL_SOCKET, libc::SCM_RIGHTS) => unsafe { Some(ControlMessage::ScmRights( slice::from_raw_parts( - &cmsg.cmsg_data as *const _ as *const _, 1))) + &cmsg.cmsg_data as *const _ as *const _, len / mem::size_of::()))) }, (_, _) => unsafe { Some(ControlMessage::Unknown(UnknownCmsg( diff --git a/test/sys/test_socket.rs b/test/sys/test_socket.rs index 9962f1f1b9..e907b4302a 100644 --- a/test/sys/test_socket.rs +++ b/test/sys/test_socket.rs @@ -236,7 +236,6 @@ pub fn test_syscontrol() { } #[test] -#[ignore] fn test_scm_rights_multiple_fd() { use std::os::unix::net::UnixDatagram; use std::os::unix::io::{RawFd, AsRawFd};