diff options
author | brooks <brooks@FreeBSD.org> | 2017-05-05 16:24:35 +0000 |
---|---|---|
committer | brooks <brooks@FreeBSD.org> | 2017-05-05 16:24:35 +0000 |
commit | 156b35dc64d8ed287788f3825fdfcbfa45cd427c (patch) | |
tree | 25d8c3aa88bfffca21a0593783c55f7a5a2537f7 /tests | |
parent | b117ba1c5528e680a7e9562705bfa395e69abbd9 (diff) | |
download | FreeBSD-src-156b35dc64d8ed287788f3825fdfcbfa45cd427c.zip FreeBSD-src-156b35dc64d8ed287788f3825fdfcbfa45cd427c.tar.gz |
MFC r317566:
Don't pass size_t arguments to setsockopt(SO_SNDBUF/SO_RCVBUF).
These commands take an int. The tests work by accident on little-endian,
64-bit systems.
PR: 218919
Tested with: qemu-cheri and CheriBSD built for mips64
Reviewed by: asomers, ngie
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Diffstat (limited to 'tests')
-rw-r--r-- | tests/sys/kern/unix_seqpacket_test.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/sys/kern/unix_seqpacket_test.c b/tests/sys/kern/unix_seqpacket_test.c index 4d157dc..e4f108f 100644 --- a/tests/sys/kern/unix_seqpacket_test.c +++ b/tests/sys/kern/unix_seqpacket_test.c @@ -127,7 +127,7 @@ shutdown_send_sigpipe_handler(int __unused x) * Parameterized test function bodies */ static void -test_eagain(size_t sndbufsize, size_t rcvbufsize) +test_eagain(int sndbufsize, int rcvbufsize) { int i; int sv[2]; @@ -165,7 +165,7 @@ test_eagain(size_t sndbufsize, size_t rcvbufsize) } static void -test_sendrecv_symmetric_buffers(size_t bufsize, int blocking) { +test_sendrecv_symmetric_buffers(int bufsize, int blocking) { int s; int sv[2]; const ssize_t pktsize = bufsize / 2; @@ -209,7 +209,7 @@ test_sendrecv_symmetric_buffers(size_t bufsize, int blocking) { } static void -test_pipe_simulator(size_t sndbufsize, size_t rcvbufsize) +test_pipe_simulator(int sndbufsize, int rcvbufsize) { int num_sent, num_received; int sv[2]; @@ -341,7 +341,7 @@ test_pipe_reader(void* args) static void -test_pipe(size_t sndbufsize, size_t rcvbufsize) +test_pipe(int sndbufsize, int rcvbufsize) { test_pipe_thread_data_t writer_data, reader_data; pthread_t writer, reader; @@ -825,8 +825,8 @@ ATF_TC_WITHOUT_HEAD(emsgsize); ATF_TC_BODY(emsgsize, tc) { int sv[2]; - const size_t sndbufsize = 8192; - const size_t rcvbufsize = 8192; + const int sndbufsize = 8192; + const int rcvbufsize = 8192; const size_t pktsize = (sndbufsize + rcvbufsize) * 2; char sndbuf[pktsize]; ssize_t ssize; @@ -854,8 +854,8 @@ ATF_TC_WITHOUT_HEAD(emsgsize_nonblocking); ATF_TC_BODY(emsgsize_nonblocking, tc) { int sv[2]; - const size_t sndbufsize = 8192; - const size_t rcvbufsize = 8192; + const int sndbufsize = 8192; + const int rcvbufsize = 8192; const size_t pktsize = (sndbufsize + rcvbufsize) * 2; char sndbuf[pktsize]; ssize_t ssize; @@ -912,8 +912,8 @@ ATF_TC_BODY(rcvbuf_oversized, tc) int i; int sv[2]; const ssize_t pktsize = 1024; - const size_t sndbufsize = 8192; - const size_t rcvbufsize = 131072; + const int sndbufsize = 8192; + const int rcvbufsize = 131072; const size_t geometric_mean_bufsize = 32768; const int numpkts = geometric_mean_bufsize / pktsize; char sndbuf[pktsize]; |