Re: [PATCH bpf] bpf: selftests: Fix error checking on reading the tcp_fastopen sysctl

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

 



On Tue, Feb 11, 2020 at 1:32 PM Martin KaFai Lau <kafai@xxxxxx> wrote:
>
> 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@xxxxxxxxxxx>
> Signed-off-by: Martin KaFai Lau <kafai@xxxxxx>
> ---

Acked-by: Andrii Nakryiko <andriin@xxxxxx>

>  tools/testing/selftests/bpf/prog_tests/select_reuseport.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> 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())
> --
> 2.17.1
>



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux