selftests/net: Cover the IP_LOCAL_PORT_RANGE socket option
authorJakub Sitnicki <jakub@cloudflare.com>
Tue, 24 Jan 2023 13:36:44 +0000 (14:36 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 26 Jan 2023 06:45:00 +0000 (22:45 -0800)
commitae5439658ccec3dcef1754dcd2ea3d3529b3508d
treefa62fd987e812eb5deeb9c25a9f3a488ce41cb2b
parent91d0b78c5177f3e42a4d8738af8ac19c3a90d002
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>
tools/testing/selftests/net/Makefile
tools/testing/selftests/net/ip_local_port_range.c [new file with mode: 0644]
tools/testing/selftests/net/ip_local_port_range.sh [new file with mode: 0755]