mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-02 19:22:47 +00:00
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
This commit is contained in:
parent
89010e783a
commit
7d4ee1b034
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/stable/10/; revision=317834
@ -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];
|
||||
|
Loading…
Reference in New Issue
Block a user