Skip to content

Commit a847241

Browse files
edumazetdavem330
authored andcommitted
selftests: net: tcp_mmap: fix SO_RCVLOWAT setting
Since chunk_size is no longer an integer, we can not use it directly as an argument of setsockopt(). This patch should fix tcp_mmap for Big Endian kernels. Fixes: 597b01e ("selftests: net: avoid ptl lock contention in tcp_mmap") Signed-off-by: Eric Dumazet <[email protected]> Cc: Soheil Hassas Yeganeh <[email protected]> Cc: Arjun Roy <[email protected]> Acked-by: Soheil Hassas Yeganeh <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f5dda31 commit a847241

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tools/testing/selftests/net/tcp_mmap.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,12 +282,14 @@ static void setup_sockaddr(int domain, const char *str_addr,
282282
static void do_accept(int fdlisten)
283283
{
284284
pthread_attr_t attr;
285+
int rcvlowat;
285286

286287
pthread_attr_init(&attr);
287288
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
288289

290+
rcvlowat = chunk_size;
289291
if (setsockopt(fdlisten, SOL_SOCKET, SO_RCVLOWAT,
290-
&chunk_size, sizeof(chunk_size)) == -1) {
292+
&rcvlowat, sizeof(rcvlowat)) == -1) {
291293
perror("setsockopt SO_RCVLOWAT");
292294
}
293295

0 commit comments

Comments
 (0)