bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrii Nakryiko <andrii.nakryiko@gmail.com>
To: Martin KaFai Lau <kafai@fb.com>
Cc: bpf <bpf@vger.kernel.org>, Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	David Miller <davem@davemloft.net>,
	Kernel Team <kernel-team@fb.com>,
	Networking <netdev@vger.kernel.org>
Subject: Re: [PATCH bpf] bpf: selftests: Fix error checking on reading the tcp_fastopen sysctl
Date: Tue, 11 Feb 2020 16:40:28 -0800	[thread overview]
Message-ID: <CAEf4BzaVAH9+y2m7p-GZk2hx+P_WdyLcku4evOKCeudNYrRd5Q@mail.gmail.com> (raw)
In-Reply-To: <20200211175910.3235321-1-kafai@fb.com>

On Tue, Feb 11, 2020 at 1:32 PM Martin KaFai Lau <kafai@fb.com> 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@hotmail.com>
> Signed-off-by: Martin KaFai Lau <kafai@fb.com>
> ---

Acked-by: Andrii Nakryiko <andriin@fb.com>

>  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
>

  reply	other threads:[~2020-02-12  0:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-11 17:59 [PATCH bpf] bpf: selftests: Fix error checking on reading the tcp_fastopen sysctl Martin KaFai Lau
2020-02-12  0:40 ` Andrii Nakryiko [this message]
2020-02-12 16:50 ` Daniel Borkmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAEf4BzaVAH9+y2m7p-GZk2hx+P_WdyLcku4evOKCeudNYrRd5Q@mail.gmail.com \
    --to=andrii.nakryiko@gmail.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=kafai@fb.com \
    --cc=kernel-team@fb.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).