From nobody Tue Nov 07 10:44:01 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SPlFY5SB9z50n2d; Tue, 7 Nov 2023 10:44:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SPlFY4lrWz3VrB; Tue, 7 Nov 2023 10:44:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699353841; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=56zyX6D0me/5ao+GTdfvhxhWgyF0SEl9tliXIlS5sRY=; b=YZBUeBHbXodiw3b/yQZQbdgO05JBnN/q91FJOtSaYUrFmhbYSn+dyPI4uYRX0MIIgz2QBl AwIhZ5utZY7cFURVgZyhRXWknPtAjA0OZlZ7hJf8PPS/LNgaJmi34Yy2l4FKPFhsFfXrgi yoFPLD7ypJKogv+rYchN8Ur8F70w0bq2IsazvjrJthS/YnsTC8tignUMDYm4TZFlqtLL49 xkBdNbAwNzAp3xySgAYIf0c9wLWmjgNVbyojTj1iFJI3nx30owrwMONgrQkngSXBrKb2Ki eFi811GD7VSb5rismNFQQxiC+sxaH3YOINUYLYb6Vdo/LmXLDGeVWE/5tQ0hzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699353841; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=56zyX6D0me/5ao+GTdfvhxhWgyF0SEl9tliXIlS5sRY=; b=kS+irAln37UbuSzPszuhRSNyjdE3SZH6auv5GpYvcSRG7bZmfBnWg2xrW30e5cBBBoUhkO xlq985/uFiKGJ+5IES8R96ayWUjUuLXZOREecGi6yUMPOrmQxNS+HyJ4DOEWTemHE/F6be F6uGrn67D4tTbQP7wOi04qyN8YW3pqytX43fjf8vgVpR6VKC+YbcXPEtH10tK6EaQzMGuh 0r42fxiyaMhHMKeIzjBX6j1scznK/HKeiwxpJsiq4mqtK2pKRaDJI2rFYpcwy9TvvqF7/W JDyKxrVqJnRrd9tk0UzvThiiGKzUnAGBn0i1bwwwRASxj9t5sBTPRMdAzMyNsQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1699353841; a=rsa-sha256; cv=none; b=UvWgsFbmSdGuXSQ8mMJXRcWKZ+KzPqJKen/Xgf+tMhQYWidEXYggneYTHpFTkL+afpvQKv Yr7v2TEtSeEPe7hLibxTsrR9SC/wYtF6vQhzZY868JiNOX9aYLCcHll6K0P3IqeC6CdJx7 MN3NU+R4i2c3HbUkJgtmi4JNIC1mkF1+jsV5pHy8B9/vn4VHmDKQsroila+dUNthcEi0Dy HTgCCRLbYwIRXnH6wyr11PfJh8GHpgnCHBnBlak23Oo1M8FlnwbWjTTFOfNTYRVfo1Xuxs WPXRzuz9SSGskNp+l7rpY4YyL9XoT7/AEehfJr4b+hpH1hHYXYklYn91w34jMg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SPlFY3q6CznDR; Tue, 7 Nov 2023 10:44:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3A7Ai1Sv067178; Tue, 7 Nov 2023 10:44:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3A7Ai1Y2067175; Tue, 7 Nov 2023 10:44:01 GMT (envelope-from git) Date: Tue, 7 Nov 2023 10:44:01 GMT Message-Id: <202311071044.3A7Ai1Y2067175@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 342bf5645f8d - stable/13 - setkey(8): make the policy specification more readable List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 342bf5645f8df8c631a93a3b35a8708310ecce6a Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=342bf5645f8df8c631a93a3b35a8708310ecce6a commit 342bf5645f8df8c631a93a3b35a8708310ecce6a Author: Konstantin Belousov AuthorDate: 2023-10-31 04:07:10 +0000 Commit: Konstantin Belousov CommitDate: 2023-11-07 10:43:37 +0000 setkey(8): make the policy specification more readable (cherry picked from commit 224fc33f603884e7eb9ed219afdd4c57ddec3cb9) --- sbin/setkey/setkey.8 | 44 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/sbin/setkey/setkey.8 b/sbin/setkey/setkey.8 index 8a0a999a7567..c99b21e53dcd 100644 --- a/sbin/setkey/setkey.8 +++ b/sbin/setkey/setkey.8 @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 27, 2023 +.Dd October 31, 2023 .Dt SETKEY 8 .Os .\" @@ -472,27 +472,43 @@ is expressed in one of the following three formats: .Xc .El .Pp -The direction of a policy must be specified as -one of: +.Bl -tag -compact -width "policy level" +.It Ar direction +The +.Ar direction +of a policy must be specified as one of: .Li out or .Li in . +.It Ar policy level The direction is followed by one of the following policy levels: .Li discard , .Li none , or .Li ipsec . +.Bl -compact -bullet +.It The .Li discard -policylevel means that packets matching the supplied indices will -be discarded while +policy level means that packets matching the supplied indices will +be discarded. +.It +The .Li none -means that IPsec operations will not take place on the packet and +policy level means that IPsec operations will not take place on +the packet. +.It +The .Li ipsec -means that IPsec operation will take place onto the packet. +policy level means that IPsec operation will take place onto +the packet. +.El +.It Ar protocol/mode/src-dst/level The .Ar protocol/mode/src-dst/level statement gives the rule for how to process the packet. +.Bl -compact -bullet +.It The .Ar protocol is specified as @@ -500,12 +516,15 @@ is specified as .Li esp or .Li ipcomp . +.It The .Ar mode is either .Li transport or .Li tunnel . +.El +.Pp If .Ar mode is @@ -517,6 +536,7 @@ and with a dash, .Sq - , between the addresses. +.Pp If .Ar mode is @@ -526,6 +546,7 @@ both and .Ar dst can be omitted. +.Pp The .Ar level is one of the following: @@ -534,25 +555,32 @@ or .Li unique . If the SA is not available in every level, the kernel will request the SA from the key exchange daemon. +.Pp +.Bl -compact -bullet +.It A value of .Li default tells the kernel to use the system wide default protocol e.g.,\& the one from the .Li esp_trans_deflev sysctl variable, when the kernel processes the packet. +.It A value of .Li use means that the kernel will use an SA if it is available, otherwise the kernel will pass the packet as it would normally. +.It A value of .Li require means that an SA is required whenever the kernel sends a packet matched that matches the policy. +.It The .Li unique level is the same as .Li require but, in addition, it allows the policy to bind with the unique out-bound SA. +.Pp For example, if you specify the policy level .Li unique , .Xr racoon 8 @@ -570,6 +598,8 @@ must be between 1 and 32767, which corresponds to .Ar extensions Fl u of manual SA configuration. +.El +.El .Pp When you want to use an SA bundle, you can define multiple rules. For