]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
ip.7: Document IP_LOCAL_PORT_RANGE socket option
authorJakub Sitnicki <jakub@cloudflare.com>
Fri, 7 Jul 2023 14:17:39 +0000 (16:17 +0200)
committerAlejandro Colomar <alx@kernel.org>
Sat, 8 Jul 2023 17:44:42 +0000 (19:44 +0200)
Linux commit 91d0b78c5177 ("inet: Add IP_LOCAL_PORT_RANGE socket option")
introduced a new socket option available for AF_INET and AF_INET6 sockets.

Option is available starting from Linux 6.3. Document it.

Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
[alx: semantic newlines]
Signed-off-by: Alejandro Colomar <alx@kernel.org>
man7/ip.7

index 92ecf4b3eb9d32ab2290b66705e7143b54f678d1..3e928adbae4388e840c466fa9648dc830c44f3ce 100644 (file)
--- a/man7/ip.7
+++ b/man7/ip.7
@@ -499,6 +499,32 @@ and
 .B IP_TOS
 are ignored.
 .TP
+.BR IP_LOCAL_PORT_RANGE " (since Linux 6.3)"
+Set or get the per-socket default local port range.
+This option can be used to clamp down the global local port range,
+defined by the
+.I ip_local_port_range
+.I /proc
+interface described below, for a given socket.
+.IP
+The option takes an
+.I uint32_t
+value with
+the high 16 bits set to the upper range bound,
+and the low 16 bits set to the lower range bound.
+Range bounds are inclusive.
+The 16-bit values should be in host byte order.
+.IP
+The lower bound has to be less than the upper bound
+when both bounds are not zero.
+Otherwise, setting the option fails with EINVAL.
+.IP
+If either bound is outside of the global local port range, or is zero,
+then that bound has no effect.
+.IP
+To reset the setting,
+pass zero as both the upper and the lower bound.
+.TP
 .BR IP_MSFILTER " (since Linux 2.4.22 / 2.5.68)"
 This option provides access to the advanced full-state filtering API.
 Argument is an