aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/tcp_client.py
diff options
context:
space:
mode:
authorJohn Fastabend <[email protected]>2020-07-28 14:39:02 +0000
committerDaniel Borkmann <[email protected]>2020-07-28 22:10:35 +0000
commitca5cd355b7f0372da0d50fce5b12a3367e417290 (patch)
tree45e98ebfacbd3c4fb092ef525c03806b548b39d6 /tools/testing/selftests/bpf/tcp_client.py
parentxdp: Prevent kernel-infoleak in xsk_getsockopt() (diff)
downloadkernel-ca5cd355b7f0372da0d50fce5b12a3367e417290.tar.gz
kernel-ca5cd355b7f0372da0d50fce5b12a3367e417290.zip
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 <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Acked-by: Song Liu <[email protected]> Acked-by: Andrii Nakryiko <[email protected]> Link: https://lore.kernel.org/bpf/159594714197.21431.10113693935099326445.stgit@john-Precision-5820-Tower
Diffstat (limited to 'tools/testing/selftests/bpf/tcp_client.py')
-rwxr-xr-xtools/testing/selftests/bpf/tcp_client.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/tcp_client.py b/tools/testing/selftests/bpf/tcp_client.py
index a53ed58528d6..bfff82be3fc1 100755
--- a/tools/testing/selftests/bpf/tcp_client.py
+++ b/tools/testing/selftests/bpf/tcp_client.py
@@ -34,7 +34,7 @@ serverPort = int(sys.argv[1])
# create active socket
sock = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
try:
- sock.connect(('localhost', serverPort))
+ sock.connect(('::1', serverPort))
except socket.error as e:
sys.exit(1)