netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ip.7: Document IP_LOCAL_PORT_RANGE socket option
@ 2023-02-01 12:36 Jakub Sitnicki
  2023-02-03 18:58 ` Stephen Hemminger
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Jakub Sitnicki @ 2023-02-01 12:36 UTC (permalink / raw)
  To: Alejandro Colomar, Michael Kerrisk; +Cc: linux-man, netdev, kernel-team

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 will be available starting from Linux 6.3. Document it.

Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
---
Submitting this man page update as the author of the feature.

We did a technical review of the man page text together with the code [1].

[1]: https://lore.kernel.org/all/20221221-sockopt-port-range-v6-0-be255cc0e51f@cloudflare.com/
---
 man7/ip.7 | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/man7/ip.7 b/man7/ip.7
index f69af1b32..f166c3b57 100644
--- a/man7/ip.7
+++ b/man7/ip.7
@@ -439,6 +439,27 @@ 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
-- 
2.39.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] ip.7: Document IP_LOCAL_PORT_RANGE socket option
  2023-02-01 12:36 [PATCH] ip.7: Document IP_LOCAL_PORT_RANGE socket option Jakub Sitnicki
@ 2023-02-03 18:58 ` Stephen Hemminger
  2023-02-03 19:09 ` Simon Horman
  2023-02-05 13:16 ` Alejandro Colomar
  2 siblings, 0 replies; 5+ messages in thread
From: Stephen Hemminger @ 2023-02-03 18:58 UTC (permalink / raw)
  To: Jakub Sitnicki
  Cc: Alejandro Colomar, Michael Kerrisk, linux-man, netdev, kernel-team

On Wed,  1 Feb 2023 13:36:34 +0100
Jakub Sitnicki <jakub@cloudflare.com> wrote:

> 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 will be available starting from Linux 6.3. Document it.
> 
> Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
> ---
> Submitting this man page update as the author of the feature.
> 
> We did a technical review of the man page text together with the code [1].
> 
> [1]: https://lore.kernel.org/all/20221221-sockopt-port-range-v6-0-be255cc0e51f@cloudflare.com/
> ---
>  man7/ip.7 | 21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)

Marking this patch as not applicable in netdev patchwork since it is for documentation
and I assume linux-man has its own tracking.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ip.7: Document IP_LOCAL_PORT_RANGE socket option
  2023-02-01 12:36 [PATCH] ip.7: Document IP_LOCAL_PORT_RANGE socket option Jakub Sitnicki
  2023-02-03 18:58 ` Stephen Hemminger
@ 2023-02-03 19:09 ` Simon Horman
  2023-02-05 13:16 ` Alejandro Colomar
  2 siblings, 0 replies; 5+ messages in thread
From: Simon Horman @ 2023-02-03 19:09 UTC (permalink / raw)
  To: Jakub Sitnicki
  Cc: Alejandro Colomar, Michael Kerrisk, linux-man, netdev, kernel-team

On Wed, Feb 01, 2023 at 01:36:34PM +0100, Jakub Sitnicki wrote:
> 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 will be available starting from Linux 6.3. Document it.
> 
> Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
> ---
> Submitting this man page update as the author of the feature.
> 
> We did a technical review of the man page text together with the code [1].
> 
> [1]: https://lore.kernel.org/all/20221221-sockopt-port-range-v6-0-be255cc0e51f@cloudflare.com/

Reviewed-by: Simon Horman <simon.horman@corigine.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ip.7: Document IP_LOCAL_PORT_RANGE socket option
  2023-02-01 12:36 [PATCH] ip.7: Document IP_LOCAL_PORT_RANGE socket option Jakub Sitnicki
  2023-02-03 18:58 ` Stephen Hemminger
  2023-02-03 19:09 ` Simon Horman
@ 2023-02-05 13:16 ` Alejandro Colomar
  2023-02-06 10:42   ` Jakub Sitnicki
  2 siblings, 1 reply; 5+ messages in thread
From: Alejandro Colomar @ 2023-02-05 13:16 UTC (permalink / raw)
  To: Jakub Sitnicki, Michael Kerrisk; +Cc: linux-man, netdev, kernel-team


[-- Attachment #1.1: Type: text/plain, Size: 2109 bytes --]

Hi Jakub,

On 2/1/23 13:36, Jakub Sitnicki wrote:
> 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 will be available starting from Linux 6.3. Document it.
> 
> Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
> ---
> Submitting this man page update as the author of the feature.
> 
> We did a technical review of the man page text together with the code [1].

The formatting LGTM.  Could you please resend when it arrives to Linus's tree?

Cheers,

Alex

> 
> [1]: https://lore.kernel.org/all/20221221-sockopt-port-range-v6-0-be255cc0e51f@cloudflare.com/
> ---
>   man7/ip.7 | 21 +++++++++++++++++++++
>   1 file changed, 21 insertions(+)
> 
> diff --git a/man7/ip.7 b/man7/ip.7
> index f69af1b32..f166c3b57 100644
> --- a/man7/ip.7
> +++ b/man7/ip.7
> @@ -439,6 +439,27 @@ 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

-- 
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ip.7: Document IP_LOCAL_PORT_RANGE socket option
  2023-02-05 13:16 ` Alejandro Colomar
@ 2023-02-06 10:42   ` Jakub Sitnicki
  0 siblings, 0 replies; 5+ messages in thread
From: Jakub Sitnicki @ 2023-02-06 10:42 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: Michael Kerrisk, linux-man, netdev, kernel-team

On Sun, Feb 05, 2023 at 02:16 PM +01, Alejandro Colomar wrote:
> [[PGP Signed Part:Undecided]]
> Hi Jakub,
>
> On 2/1/23 13:36, Jakub Sitnicki wrote:
>> 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 will be available starting from Linux 6.3. Document it.
>> Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
>> ---
>> Submitting this man page update as the author of the feature.
>> We did a technical review of the man page text together with the code [1].
>
> The formatting LGTM.  Could you please resend when it arrives to Linus's tree?

Thanks for the review, Alex. Will do.

-Jakub

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-02-06 10:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-01 12:36 [PATCH] ip.7: Document IP_LOCAL_PORT_RANGE socket option Jakub Sitnicki
2023-02-03 18:58 ` Stephen Hemminger
2023-02-03 19:09 ` Simon Horman
2023-02-05 13:16 ` Alejandro Colomar
2023-02-06 10:42   ` Jakub Sitnicki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).