From owner-dev-commits-src-main@freebsd.org Tue Aug 10 00:49:25 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7148F65F518; Tue, 10 Aug 2021 00:49:25 +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 4GkDqT2Ybcz4dLD; Tue, 10 Aug 2021 00:49:25 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 2F42B122D2; Tue, 10 Aug 2021 00:49:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17A0nPYh061550; Tue, 10 Aug 2021 00:49:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17A0nPwe061549; Tue, 10 Aug 2021 00:49:25 GMT (envelope-from git) Date: Tue, 10 Aug 2021 00:49:25 GMT Message-Id: <202108100049.17A0nPwe061549@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 4a5a67fe679d - main - ip(4): Mention IP_IPSEC_POLICY ip-level socket option 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/main X-Git-Reftype: branch X-Git-Commit: 4a5a67fe679d6b29957bf87dbf2e7c08ff97bb30 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Aug 2021 00:49:25 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4a5a67fe679d6b29957bf87dbf2e7c08ff97bb30 commit 4a5a67fe679d6b29957bf87dbf2e7c08ff97bb30 Author: Konstantin Belousov AuthorDate: 2021-08-09 11:07:18 +0000 Commit: Konstantin Belousov CommitDate: 2021-08-10 00:46:49 +0000 ip(4): Mention IP_IPSEC_POLICY ip-level socket option Text is literally taken from NetBSD ip(4). Sponsored by: NVIDIA Networking MFC after: 3 days --- share/man/man4/ip.4 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/share/man/man4/ip.4 b/share/man/man4/ip.4 index c53cd3d5aeda..24b06846e66f 100644 --- a/share/man/man4/ip.4 +++ b/share/man/man4/ip.4 @@ -28,7 +28,7 @@ .\" @(#)ip.4 8.2 (Berkeley) 11/30/93 .\" $FreeBSD$ .\" -.Dd May 24, 2020 +.Dd August 9, 2021 .Dt IP 4 .Os .Sh NAME @@ -109,6 +109,15 @@ int ttl = 60; /* max = 255 */ setsockopt(s, IPPROTO_IP, IP_TTL, &ttl, sizeof(ttl)); .Ed .Pp +.Dv IP_IPSEC_POLICY +controls IPSec policy for sockets. +For example, +.Bd -literal +const char *policy = "in ipsec ah/transport//require"; +char *buf = ipsec_set_policy(policy, strlen(policy)); +setsockopt(s, IPPROTO_IP, IP_IPSEC_POLICY, buf, ipsec_get_policylen(buf)); +.Ed +.Pp .Dv IP_MINTTL may be used to set the minimum acceptable TTL a packet must have when received on a socket.