]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: Fix race in tcp_rtt test
authorAndrii Nakryiko <andriin@fb.com>
Sat, 14 Mar 2020 01:39:30 +0000 (18:39 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 17 Mar 2020 18:30:26 +0000 (19:30 +0100)
commit72b3987026b0bd56e80ab8ebf23bfe2c33df63af
treeb3656959de1c71aef7b0092bbc7cc6a6022c464e
parentb9f58a34c0f9620ea4e2de2ecd3d37c3737c2168
selftests/bpf: Fix race in tcp_rtt test

Previous attempt to make tcp_rtt more robust introduced a new race, in which
server_done might be set to true before server can actually accept any
connection. Fix this by unconditionally waiting for accept(). Given socket is
non-blocking, if there are any problems with client side, it should eventually
close listening FD and let server thread exit with failure.

Fixes: 78633b5c38fa ("selftests/bpf: Make tcp_rtt test more robust to failures")
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/bpf/20200314013932.4035712-1-andriin@fb.com
tools/testing/selftests/bpf/prog_tests/tcp_rtt.c