bpf: selftests: Fix error checking on reading the tcp_fastopen sysctl
Subsystems (5)
PATCH 1/1 bpf: selftests: 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]>
--- tools/testing/selftests/bpf/prog_tests/select_reuseport.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
tools/testing/selftests/bpf/prog_tests/select_reuseport.c +3 -1
@@ -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 ())
Signature · 1 line
2.17.1
Quoted 9 lines · Martin KaFai Lau
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]>---
Acked-by Andrii Nakryiko <[email protected]>
Quoted 22 lines
tools/testing/selftests/bpf/prog_tests/select_reuseport.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)tools/testing/selftests/bpf/prog_tests/select_reuseport.c +3
-2@@ -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 ()) --2.17.1
Quoted 7 lines · Martin KaFai Lau
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]>
Applied, thanks!