From nobody Fri Jul 12 11:25:02 2024 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 4WL8QR3Pr8z5QBrc; Fri, 12 Jul 2024 11:25:03 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WL8QR09lZz4jD4; Fri, 12 Jul 2024 11:25:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720783503; 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=AV8keYdxoBj7VetCSIv+blhXpwXgT4TuZlIbNm68v2I=; b=ojGGSgxlgWttpqSiCupN4Q6oXLqOCHF6Bnye7ARcRAAFpH91dtdtr3Ev5LK1fnxYMisYgJ vEypNvceUVA/vuhyIVcaD83wI+WnLJYHAcilJLnjzpWyZIhHjCogUlXV72MgJxFHpNo7hZ fReVrH1bXu/0jbmiC1oq5avYuajOO+s3EHLkMTMFVhNerglatiQmCGkZKIvX28S0y2J3FK 3hY4+nQQG5i8rjKEoiXb7J2SRxZb6+jRWzg6iptDG6CnCsiYTt0pzplg6ofAlRo8+ZkT0q zsT5myLlGDUAcTKMDkNbVOc7t1oJgwKOV2/YTsgfNpHCMz7QKTWNIi1P0IUNBA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720783503; a=rsa-sha256; cv=none; b=vWpGOPWDpRnymLxdvxE2Xt8OMiyDlrYjFcuLg4tdTjPsd23yUEcQJRcNnh+yp+yuUimAaI Kol3+50lFKLLwFlZuBOAa+3K1WKUhiw4MI8WK6btDF0qXllzNC5YCHXK0mOTUyeCQHCLUk CkUcpoFE9TECVS05f5x5BBwHMfn2GQSyi56uQb0qKqSp81x/ZkIwJhzrywPo3JydjhM6G/ oz7dXsoDXhctagykPVrVDf5iBDMpZPiiOwj0cXJRKnT7ErxYmPjhGamCE2UYdndbZBcWWA ZXUJvqoRqh1vFdSIexNjiyfkSiYseRCFVoVYT4EpbFeJB+FmYsUKA0aCj63IDg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720783503; 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=AV8keYdxoBj7VetCSIv+blhXpwXgT4TuZlIbNm68v2I=; b=tiVA8yi1ItT+LylZ53E0E89dUmDjAsCeDl8OO1W7Efe/b6rV+oL9Xvb0IKhKJqdQOCL9CN CEd+ZCFd2Fw5P0omIEwmYtXrHJ6ow5iVpUjRj79SfLz5tClYGGGLzqJkNZktn7s1udBlni g6/kvnoIMtT4DHENCA1BpkoAKgN+CpUC4GKP5LUQZVcY7Zwj66Ufm+Rc6gKopN4AVLrDlV xEw1rymFkYVv1HauUxsCb9XfndKtDrktdhdjpwsUxBgvEvB4DMfcg8VqNEYpYjTN9OuQrU f8XATdTBIgTBcmp34QiEUOkH6U1QhVvgNNfC0jvNzLI80/GPbVzRdp/s/QvcWg== 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 4WL8QQ6vJTzhDy; Fri, 12 Jul 2024 11:25:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46CBP2vj092871; Fri, 12 Jul 2024 11:25:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46CBP2cs092868; Fri, 12 Jul 2024 11:25:02 GMT (envelope-from git) Date: Fri, 12 Jul 2024 11:25:02 GMT Message-Id: <202407121125.46CBP2cs092868@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: 9b93b2d8b039 - main - setkey(8): add -esn extension option to enable ESN 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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/main X-Git-Reftype: branch X-Git-Commit: 9b93b2d8b039e24d8e2505a6aaf8bc1f29863052 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9b93b2d8b039e24d8e2505a6aaf8bc1f29863052 commit 9b93b2d8b039e24d8e2505a6aaf8bc1f29863052 Author: Konstantin Belousov AuthorDate: 2023-09-07 12:04:49 +0000 Commit: Konstantin Belousov CommitDate: 2024-07-12 03:29:32 +0000 setkey(8): add -esn extension option to enable ESN Sponsored by: NVIDIA networking --- sbin/setkey/parse.y | 10 ++++++++++ sbin/setkey/setkey.8 | 2 ++ sbin/setkey/token.l | 1 + 3 files changed, 13 insertions(+) diff --git a/sbin/setkey/parse.y b/sbin/setkey/parse.y index 448a8ee5278c..27a0109db333 100644 --- a/sbin/setkey/parse.y +++ b/sbin/setkey/parse.y @@ -46,6 +46,7 @@ #include #include +#include #include #include #include @@ -68,6 +69,7 @@ u_int p_natt_type; struct addrinfo *p_natt_oai, *p_natt_oar; int p_natt_sport, p_natt_dport; int p_natt_fraglen; +bool esn; static int p_aiflags = 0, p_aifamily = PF_UNSPEC; @@ -115,6 +117,7 @@ extern void yyerror(const char *); %token SPDADD SPDDELETE SPDDUMP SPDFLUSH %token F_POLICY PL_REQUESTS %token F_AIFLAGS F_NATT F_NATT_MTU +%token F_ESN %token TAGGED %type prefix protocol_spec upper_spec @@ -539,6 +542,11 @@ extension { p_natt_fraglen = $2; } + | F_ESN + { + esn = true; + p_ext |= SADB_X_SAFLAGS_ESN; + } ; /* definition about command for SPD management */ @@ -1355,6 +1363,8 @@ parse_init(void) p_natt_oai = p_natt_oar = NULL; p_natt_sport = p_natt_dport = 0; p_natt_fraglen = -1; + + esn = false; } void diff --git a/sbin/setkey/setkey.8 b/sbin/setkey/setkey.8 index 88b4dc6fc91f..23a838f76541 100644 --- a/sbin/setkey/setkey.8 +++ b/sbin/setkey/setkey.8 @@ -341,6 +341,8 @@ symbols are part of the syntax for the ports specification, not indication of the optional components. .It Fl natt_mtu Ar fragsize Configure NAT-T fragment size. +.It Fl esn +Enable Extended Sequence Number extension for this SA. .El .\" .Pp diff --git a/sbin/setkey/token.l b/sbin/setkey/token.l index 054a57ef1015..b96eaf93924c 100644 --- a/sbin/setkey/token.l +++ b/sbin/setkey/token.l @@ -187,6 +187,7 @@ nocyclic-seq { return(NOCYCLICSEQ); } {hyphen}ls { return(F_LIFETIME_SOFT); } {hyphen}natt { return(F_NATT); } {hyphen}natt_mtu { return(F_NATT_MTU); } +{hyphen}esn { return(F_ESN); } /* ... */ any { return(ANY); }