Skip to content

Commit

Permalink
selftests/bpf: Fix error checking on reading the tcp_fastopen sysctl
Browse files Browse the repository at this point in the history
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 <dcb314@hotmail.com>
Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/20200211175910.3235321-1-kafai@fb.com
  • Loading branch information
Martin KaFai Lau authored and Daniel Borkmann committed Feb 12, 2020
1 parent 30744a6 commit 2fe7710
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tools/testing/selftests/bpf/prog_tests/select_reuseport.c
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 2fe7710

Please sign in to comment.