Skip to content

Commit abc22f1

Browse files
xingxue-ibmtgross35
authored andcommitted
Only test addresses of cmsghdrs that are multiples of the size of cmsghdr.
(backport <rust-lang#4916>) (cherry picked from commit 85a3691)
1 parent b3fa226 commit abc22f1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

libc-test/tests/cmsg.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,14 @@ mod t {
7474
mhdr.msg_controllen = (160 - trunc) as _;
7575

7676
for cmsg_payload_len in 0..64 {
77+
// AIX does not apply any alignment or padding to ancillary
78+
// data and CMSG_ALIGN() is a noop. So only test addresses
79+
// that are multiples of the size of cmsghdr here.
80+
if cfg!(target_os = "aix") && cmsg_payload_len % std::mem::size_of::<cmsghdr>() != 0
81+
{
82+
continue;
83+
}
84+
7785
let mut current_cmsghdr_ptr = pcmsghdr;
7886
assert!(!current_cmsghdr_ptr.is_null());
7987
let mut count = 0;

0 commit comments

Comments
 (0)