OSDN Git Service

bpf, selftest: Fix flaky tcp_hdr_options test when adding addr to lo
authorMartin KaFai Lau <kafai@fb.com>
Mon, 12 Oct 2020 23:49:40 +0000 (16:49 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 15 Oct 2020 18:53:15 +0000 (20:53 +0200)
commit8a3feed90e75283f15f830b1051bf048e4127c91
tree111329e7cc442c40da9fca527c45fcbc133af62b
parentf58423aeab28f861b67933206f322f764f05787d
bpf, selftest: Fix flaky tcp_hdr_options test when adding addr to lo

The tcp_hdr_options test adds a "::eB9F" addr to the lo dev.
However, this non loopback address will have a race on ipv6 dad
which may lead to EADDRNOTAVAIL error from time to time.

Even nodad is used in the iproute2 command, there is still a race in
when the route will be added.  This will then lead to ENETUNREACH from
time to time.

To avoid the above, this patch uses the default loopback address "::1"
to do the test.

Fixes: ad2f8eb0095e ("bpf: selftests: Tcp header options")
Reported-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20201012234940.1707941-1-kafai@fb.com
tools/testing/selftests/bpf/prog_tests/tcp_hdr_options.c
tools/testing/selftests/bpf/progs/test_misc_tcp_hdr_options.c