42 lines
1.5 KiB
Diff
42 lines
1.5 KiB
Diff
|
|
From e4bfb1b17a1e548bdc96228a80e85c97eedf0299 Mon Sep 17 00:00:00 2001
|
||
|
|
From: tangbinzy <tangbin_yewu@cmss.chinamobile.com>
|
||
|
|
Date: Thu, 21 Mar 2024 02:57:07 +0000
|
||
|
|
Subject: [PATCH] tests/tcg/linux-test: Fix random hangs in test_socket
|
||
|
|
mainline inclusion commit b9e6074fc5b429b1e956e9c60db7e284a91e0f3d category:
|
||
|
|
bugfix
|
||
|
|
|
||
|
|
---------------------------------------------------------------
|
||
|
|
|
||
|
|
test_socket hangs randomly in connect(), especially when run without
|
||
|
|
qemu. Apparently the reason is that linux started treating backlog
|
||
|
|
value of 0 literally instead of rounding it up since v4.4 (commit
|
||
|
|
ef547f2ac16b).
|
||
|
|
|
||
|
|
So set it to 1 instead.
|
||
|
|
|
||
|
|
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
|
||
|
|
Message-Id: <20220725144251.192720-1-iii@linux.ibm.com>
|
||
|
|
Signed-off-by: Thomas Huth <thuth@redhat.com>
|
||
|
|
|
||
|
|
Signed-off-by: tangbinzy <tangbin_yewu@cmss.chinamobile.com>
|
||
|
|
---
|
||
|
|
tests/tcg/multiarch/linux/linux-test.c | 2 +-
|
||
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||
|
|
|
||
|
|
diff --git a/tests/tcg/multiarch/linux/linux-test.c b/tests/tcg/multiarch/linux/linux-test.c
|
||
|
|
index 78c68540ef..64f57cb287 100644
|
||
|
|
--- a/tests/tcg/multiarch/linux/linux-test.c
|
||
|
|
+++ b/tests/tcg/multiarch/linux/linux-test.c
|
||
|
|
@@ -263,7 +263,7 @@ static int server_socket(void)
|
||
|
|
sockaddr.sin_port = htons(0); /* choose random ephemeral port) */
|
||
|
|
sockaddr.sin_addr.s_addr = 0;
|
||
|
|
chk_error(bind(fd, (struct sockaddr *)&sockaddr, sizeof(sockaddr)));
|
||
|
|
- chk_error(listen(fd, 0));
|
||
|
|
+ chk_error(listen(fd, 1));
|
||
|
|
return fd;
|
||
|
|
|
||
|
|
}
|
||
|
|
--
|
||
|
|
2.27.0
|
||
|
|
|