mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-17 07:14:25 +00:00
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>
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user