Date: Fri, 28 Apr 2017 17:58:16 +0000 (UTC) From: Brooks Davis <brooks@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317566 - head/tests/sys/kern Message-ID: <201704281758.v3SHwG0n077209@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: brooks Date: Fri Apr 28 17:58:15 2017 New Revision: 317566 URL: https://svnweb.freebsd.org/changeset/base/317566 Log: Don't pass size_t arguments to setsockopt(SO_SNDBUF/SO_RCVBUF). These command 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 MFC after: 1 week Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D10518 Modified: head/tests/sys/kern/unix_seqpacket_test.c Modified: head/tests/sys/kern/unix_seqpacket_test.c ============================================================================== --- head/tests/sys/kern/unix_seqpacket_test.c Fri Apr 28 17:57:07 2017 (r317565) +++ head/tests/sys/kern/unix_seqpacket_test.c Fri Apr 28 17:58:15 2017 (r317566) @@ -127,7 +127,7 @@ shutdown_send_sigpipe_handler(int __unus * 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 rc } 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 b } 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; @@ -875,8 +875,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; @@ -904,8 +904,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; @@ -962,8 +962,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];
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201704281758.v3SHwG0n077209>