summaryrefslogtreecommitdiff
path: root/tools/testing
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2024-04-29 17:44:24 +0300
committerJakub Kicinski <kuba@kernel.org>2024-04-30 18:15:32 +0300
commitee2512d6bf4168998f3c218fb33ed50544e69e3c (patch)
treec8a117497da484584150e9df0005fad58cdc1e27 /tools/testing
parent32a4ca1361d7a51e5003d4af4dfbf570f1b5fd00 (diff)
downloadlinux-ee2512d6bf4168998f3c218fb33ed50544e69e3c.tar.xz
selftests: net: py: avoid all ports < 10k
When picking TCP ports to use, avoid all below 10k. This should lower the chance of collision or running afoul whatever random policies may be on the host. Reviewed-by: Willem de Bruijn <willemb@google.com> Link: https://lore.kernel.org/r/20240429144426.743476-5-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/testing')
-rw-r--r--tools/testing/selftests/net/lib/py/utils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/net/lib/py/utils.py b/tools/testing/selftests/net/lib/py/utils.py
index 4930a90a64ea..b57d467afd0f 100644
--- a/tools/testing/selftests/net/lib/py/utils.py
+++ b/tools/testing/selftests/net/lib/py/utils.py
@@ -77,7 +77,7 @@ def rand_port():
"""
Get unprivileged port, for now just random, one day we may decide to check if used.
"""
- return random.randint(1024, 65535)
+ return random.randint(10000, 65535)
def wait_port_listen(port, proto="tcp", ns=None, host=None, sleep=0.005, deadline=5):