# Re: \[PATCH bpf\] bpf: selftest: Fix flaky tcp\_hdr\_options test when adding addr to lo

- From: Andrii Nakryiko \<hidden\>
- Date: 2020-10-14 09:22:20 
- List: netdev
- Page: https://ratatoskr.run/netdev/2020/10/7749416
- Thread: https://ratatoskr.run/bpf/2020/10/7749396/t.md

```text
On Tue, Oct 13, 2020 at 4:13 AM Martin KaFai Lau [ref] wrote:
>
> 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 <redacted>
> Signed-off-by: Martin KaFai Lau <redacted>
> ---

Less shelling out is always good :)

Acked-by: Andrii Nakryiko <andrii@kernel.org>

>  .../bpf/prog_tests/tcp_hdr_options.c          | 26 +------------------
>  .../bpf/progs/test_misc_tcp_hdr_options.c     |  2 +-
>  2 files changed, 2 insertions(+), 26 deletions(-)
>

[...]
```
