diff options
author | John Fastabend <john.fastabend@gmail.com> | 2020-07-28 17:39:02 +0300 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2020-07-29 01:10:35 +0300 |
commit | ca5cd355b7f0372da0d50fce5b12a3367e417290 (patch) | |
tree | 45e98ebfacbd3c4fb092ef525c03806b548b39d6 /tools/testing/selftests/bpf/test_netcnt.c | |
parent | 3c4f850e8441ac8b3b6dbaa6107604c4199ef01f (diff) | |
download | linux-ca5cd355b7f0372da0d50fce5b12a3367e417290.tar.xz |
bpf, selftests: use :: 1 for localhost in tcp_server.py
Using localhost requires the host to have a /etc/hosts file with that
specific line in it. By default my dev box did not, they used
ip6-localhost, so the test was failing. To fix remove the need for any
/etc/hosts and use ::1.
I could just add the line, but this seems easier.
Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Song Liu <songliubraving@fb.com>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/159594714197.21431.10113693935099326445.stgit@john-Precision-5820-Tower
Diffstat (limited to 'tools/testing/selftests/bpf/test_netcnt.c')
-rw-r--r-- | tools/testing/selftests/bpf/test_netcnt.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/testing/selftests/bpf/test_netcnt.c b/tools/testing/selftests/bpf/test_netcnt.c index c1da5404454a..7a68c9069639 100644 --- a/tools/testing/selftests/bpf/test_netcnt.c +++ b/tools/testing/selftests/bpf/test_netcnt.c @@ -82,9 +82,9 @@ int main(int argc, char **argv) } if (system("which ping6 &>/dev/null") == 0) - assert(!system("ping6 localhost -c 10000 -f -q > /dev/null")); + assert(!system("ping6 ::1 -c 10000 -f -q > /dev/null")); else - assert(!system("ping -6 localhost -c 10000 -f -q > /dev/null")); + assert(!system("ping -6 ::1 -c 10000 -f -q > /dev/null")); if (bpf_prog_query(cgroup_fd, BPF_CGROUP_INET_EGRESS, 0, NULL, NULL, &prog_cnt)) { |