diff options
author | Jakub Sitnicki <jakub@cloudflare.com> | 2023-01-24 16:36:44 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2023-01-26 09:45:00 +0300 |
commit | ae5439658ccec3dcef1754dcd2ea3d3529b3508d (patch) | |
tree | fa62fd987e812eb5deeb9c25a9f3a488ce41cb2b /tools/testing/selftests/net/ip_local_port_range.sh | |
parent | 91d0b78c5177f3e42a4d8738af8ac19c3a90d002 (diff) | |
download | linux-ae5439658ccec3dcef1754dcd2ea3d3529b3508d.tar.xz |
selftests/net: Cover the IP_LOCAL_PORT_RANGE socket option
Exercise IP_LOCAL_PORT_RANGE socket option in various scenarios:
1. pass invalid values to setsockopt
2. pass a range outside of the per-netns port range
3. configure a single-port range
4. exhaust a configured multi-port range
5. check interaction with late-bind (IP_BIND_ADDRESS_NO_PORT)
6. set then get the per-socket port range
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/testing/selftests/net/ip_local_port_range.sh')
-rwxr-xr-x | tools/testing/selftests/net/ip_local_port_range.sh | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/testing/selftests/net/ip_local_port_range.sh b/tools/testing/selftests/net/ip_local_port_range.sh new file mode 100755 index 000000000000..6c6ad346eaa0 --- /dev/null +++ b/tools/testing/selftests/net/ip_local_port_range.sh @@ -0,0 +1,5 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 + +./in_netns.sh \ + sh -c 'sysctl -q -w net.ipv4.ip_local_port_range="40000 49999" && ./ip_local_port_range' |