Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 850E3C636CD for ; Wed, 1 Feb 2023 12:36:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231520AbjBAMgl (ORCPT ); Wed, 1 Feb 2023 07:36:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230514AbjBAMgk (ORCPT ); Wed, 1 Feb 2023 07:36:40 -0500 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C3865B59C for ; Wed, 1 Feb 2023 04:36:37 -0800 (PST) Received: by mail-ej1-x62b.google.com with SMTP id dr8so29404875ejc.12 for ; Wed, 01 Feb 2023 04:36:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudflare.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=UG0+CbPKl+yc+rOVVgUYjitIGI/X5mZqO7Eu1sUc9pk=; b=sj8VF/6y8FqJEFfS5LWKl26EHboGDrVqumt4cfjJd1NPIGVsdyiRMDkSkVqlkIdy7O ajupPh4QVyggboOVJvbX2dw6xY6SB+xlzAvUuXvMlNNPrTlKnZKT5gBZ5xNCt/qRaRKI fOKnuUY1fzEQbcF6iP5Q3SQUzTMq2PliL+Y8k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=UG0+CbPKl+yc+rOVVgUYjitIGI/X5mZqO7Eu1sUc9pk=; b=nRF4CAOF29gh9/gG2D5aPL1vP+q8irM9NtVo1j42U1IKRisW93sh+ETIdJmaZYkp+L z/4h7XUobUVpJ370+urB2f6ifMygCQBPZsmGkWMnROV7XegN0B+2m2eEc5+7xRRRi4hA 3j+tab96XLDDeA2uoUoJg4/jJ9ckxo5gEmK+p73zBxd2fwmXn8R+vBA7p670DEl0b6R6 Gkn0vFZt9moRn9jOJslmbHJQMgFXQIDXQHsAfh8ff+GVW2789+CF7Yq+LtyyIRbvsKlZ GFN5cVPkhUxaboirBEbtipj9jyo6jIFyJDkQ1ya3YVP8G+BYW+C+rvGH8eRzZwpU5WhW cJZw== X-Gm-Message-State: AO0yUKW4ehicW9K4gW6JmYbDr0QZysACLNcILAECG4VlIPYFUbq9nLZV 4py7Ej0Cca2d3ybOs7SPPLYAsw== X-Google-Smtp-Source: AK7set8cgNtpP8ym9uEQjpSd9da0X2g2FDEmnwRraaDsncowbdnWvVfCMcAYTvHwaR/TacmF//efkg== X-Received: by 2002:a17:906:1659:b0:88c:bc3e:de46 with SMTP id n25-20020a170906165900b0088cbc3ede46mr2203792ejd.34.1675254996014; Wed, 01 Feb 2023 04:36:36 -0800 (PST) Received: from cloudflare.com (79.191.53.204.ipv4.supernova.orange.pl. [79.191.53.204]) by smtp.gmail.com with ESMTPSA id 17-20020a170906059100b0085fc3dec567sm10035066ejn.175.2023.02.01.04.36.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 04:36:35 -0800 (PST) From: Jakub Sitnicki To: Alejandro Colomar , Michael Kerrisk Cc: linux-man@vger.kernel.org, netdev@vger.kernel.org, kernel-team@cloudflare.com Subject: [PATCH] ip.7: Document IP_LOCAL_PORT_RANGE socket option Date: Wed, 1 Feb 2023 13:36:34 +0100 Message-Id: <20230201123634.284689-1-jakub@cloudflare.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-man@vger.kernel.org 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 --- 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