Skip to content

Commit 90f2740

Browse files
committed
Try to debug test_recvif on OSX. Don't merge!
1 parent 327568f commit 90f2740

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/sys/socket/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,10 @@ pub fn recvmsg<'a>(fd: RawFd, iov: &[IoVec<&mut [u8]>],
885885
// got control message(s)
886886
debug_assert!(!mhdr.msg_control.is_null());
887887
debug_assert!(msg_controllen >= mhdr.msg_controllen as usize);
888-
CMSG_FIRSTHDR(&mhdr as *const msghdr)
888+
let hdr = CMSG_FIRSTHDR(&mhdr as *const msghdr);
889+
println!("cmsghdr: cmsg_len={}, cmsg_level={}, cmsg_type={}",
890+
(*hdr).cmsg_len, (*hdr).cmsg_level, (*hdr).cmsg_type);
891+
hdr
889892
} else {
890893
ptr::null()
891894
}.as_ref()

test/sys/test_socket.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,9 @@ pub fn test_recvif() {
708708
panic!("unexpected Sockaddr");
709709
}
710710
},
711+
ControlMessageOwned::Unknown(_) => {
712+
panic!("Unexpected unknown control message");
713+
}
711714
_ => panic!("unexpected additional control msg"),
712715
}
713716
}

0 commit comments

Comments
 (0)