[nf PATCH] selftests: netfilter: Avoid hanging ipvs.sh

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If the client can't reach the server, the latter remains listening
forever. Kill it after 3s of waiting.

Fixes: 867d2190799ab ("selftests: netfilter: add ipvs test script")
Signed-off-by: Phil Sutter <phil@xxxxxx>
---
 tools/testing/selftests/net/netfilter/ipvs.sh | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/testing/selftests/net/netfilter/ipvs.sh b/tools/testing/selftests/net/netfilter/ipvs.sh
index 4ceee9fb3949..59d7aecbd887 100755
--- a/tools/testing/selftests/net/netfilter/ipvs.sh
+++ b/tools/testing/selftests/net/netfilter/ipvs.sh
@@ -107,6 +107,10 @@ client_connect() {
 }
 
 verify_data() {
+	waitpid -t 3 "${server_pid}"
+	if [ $? -eq 3 ]; then
+		kill "${server_pid}"
+	fi
 	wait "${server_pid}"
 	cmp "$infile" "$outfile" 2>/dev/null
 }
-- 
2.43.0





[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux