aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/tcp_client.py
diff options
context:
space:
mode:
authorStanislav Fomichev <sdf@google.com>2019-02-04 10:43:19 -0800
committerDaniel Borkmann <daniel@iogearbox.net>2019-02-04 21:29:27 +0100
commit7e8a5903774bc5ce76efc1ed2782fa906e58f8a8 (patch)
treebf0eaff7514b47154c6740cb3fce04a4c0219ca9 /tools/testing/selftests/bpf/tcp_client.py
parents390: bpf: fix JMP32 code-gen (diff)
downloadlinux-dev-7e8a5903774bc5ce76efc1ed2782fa906e58f8a8.tar.xz
linux-dev-7e8a5903774bc5ce76efc1ed2782fa906e58f8a8.zip
selftests/bpf: use localhost in tcp_{server,client}.py
Bind and connect to localhost. There is no reason for this test to use non-localhost interface. This lets us run this test in a network namespace. Signed-off-by: Stanislav Fomichev <sdf@google.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/testing/selftests/bpf/tcp_client.py')
-rwxr-xr-xtools/testing/selftests/bpf/tcp_client.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/testing/selftests/bpf/tcp_client.py b/tools/testing/selftests/bpf/tcp_client.py
index 7f8200a8702b..a53ed58528d6 100755
--- a/tools/testing/selftests/bpf/tcp_client.py
+++ b/tools/testing/selftests/bpf/tcp_client.py
@@ -30,12 +30,11 @@ def send(sock, s):
serverPort = int(sys.argv[1])
-HostName = socket.gethostname()
# create active socket
sock = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
try:
- sock.connect((HostName, serverPort))
+ sock.connect(('localhost', serverPort))
except socket.error as e:
sys.exit(1)