aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin KaFai Lau <[email protected]>2020-02-11 09:59:10 -0800
committerDaniel Borkmann <[email protected]>2020-02-12 17:44:37 +0100
commit2fe77100553f3ac6b2105db8ae14b5ea4b43c108 (patch)
tree7ea21429a96895c05e3f8ecdd8c018a2641feacf
parent30744a68626db6a0029aca9c646831c869c16d83 (diff)
selftests/bpf: Fix error checking on reading the tcp_fastopen sysctl
There is a typo in checking the "saved_tcp_fo" and instead "saved_tcp_syncookie" is checked again. This patch fixes it and also breaks them into separate if statements such that the test will abort asap. Reported-by: David Binderman <[email protected]> Signed-off-by: Martin KaFai Lau <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Acked-by: Andrii Nakryiko <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
-rw-r--r--tools/testing/selftests/bpf/prog_tests/select_reuseport.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/select_reuseport.c b/tools/testing/selftests/bpf/prog_tests/select_reuseport.c
index 098bcae5f827..b577666d028e 100644
--- a/tools/testing/selftests/bpf/prog_tests/select_reuseport.c
+++ b/tools/testing/selftests/bpf/prog_tests/select_reuseport.c
@@ -822,8 +822,10 @@ void test_select_reuseport(void)
goto out;
saved_tcp_fo = read_int_sysctl(TCP_FO_SYSCTL);
+ if (saved_tcp_fo < 0)
+ goto out;
saved_tcp_syncookie = read_int_sysctl(TCP_SYNCOOKIE_SYSCTL);
- if (saved_tcp_syncookie < 0 || saved_tcp_syncookie < 0)
+ if (saved_tcp_syncookie < 0)
goto out;
if (enable_fastopen())