]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitd61f9c4f6bbe7d25d8d12fb94bc211bc3ee6d113
tree111329e7cc442c40da9fca527c45fcbc133af62b
parentb6d1a2b16036fe87b1f30dd11a4881cebb59280b
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: e98593f2fe1c ("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