From nobody Fri Jul 12 11:24:58 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 4WL8QL48KZz5QBgX; Fri, 12 Jul 2024 11:24:58 +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 4WL8QL3JmKz4hlV; Fri, 12 Jul 2024 11:24:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720783498; 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=SYnKnq36aYQuocv0ID8oi6FIJevxQqYoS+h6TA/aLAo=; b=YRvGkK3jsSvS3Mu1iJbBPtgXDHC4G2XHqvau9nf9I9COfTXK0bjFS76SgNob7UO4HqhSqE kRViaGDNdGVD6rBTKz2N6t/EEQILsTwYH9Eh4o5W4sF1Hb/sn2RzxFv0gLK4RsHzRzDC/h vcf4ryEJpRKh17LxADlqSqhr+1/XH25ks6G/4fHzpSBinKBk5liyAI5Fex1M7RHBjzrFQr KQW5dgy+cvXLyAO/6Pf0qVcup79zVdahh/3GuRPx6p7vdDZdSTQJXB4kCkkEEC6BkZdydw E5JduyWvN2P0p80XNycHu8KwfTIVMac6wMbwA8bRXBphmQnPFejdMnuMeVnKrA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720783498; a=rsa-sha256; cv=none; b=vEOki1jn3zxhcJBJ1UU0DQsSrLeQL+wOALcXS1R18aSC2SCbkWvvS8IbnAWMqvVSYZhs0l 13DtmHpis+fWRdgwLQ1oAuIlm/yOaPA5xm9XUkdol++yeiWoM3ni80cW6NJLoEDoXWCdx9 d/Ajejk6npNKF8Rs3w16Xsw3qyL+N7Rpbcg1+7LYKRH/1qH+OSNiu2t0jSZIoWugUbvj26 5NUABN1zghWgpkx0ebiAMpA91spBjUU3kFB6DA1bkxmkux4BqJU5p4CnQEFElAF/oGJBo9 Oo3EgrPr4nH2XOzegK9Yb4pzSZGFWcycunGv1SM8bkXEB7VhlUc3IT6rvhqjhw== 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=1720783498; 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=SYnKnq36aYQuocv0ID8oi6FIJevxQqYoS+h6TA/aLAo=; b=rImBxWu30cltnKzr+mHByotKVRcCIlZGyery6aFhCyE4cvcNOHvA03dy4raX+f4erdl1ku 60fmAXacRhpJbNMA2mjtS01SPN7gsYQgX2jq8z3HXmnNcA4YetMRdyXWkTq2HdKZvbwg2k FNGZ1ioOGrhK9cZdSi3ciBFwKavgQdB99z264271jWHktm7/4DWIe2N7nnHF0vofCJrrHT FYfa+Ctq/L7q4rIFqXjy7PiwJCEqRMsyjCVKVA+B3mVdnquPHGSINi6VREIEdukSnP4uQu KIRn8DXaIvU2SRIbXg0f1LOL7NT0QUFDL7WFxt6LBqbDoQzZrOcgzDAPnV6Gsg== 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 4WL8QL2tFWzhVf; Fri, 12 Jul 2024 11:24:58 +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 46CBOwkb092651; Fri, 12 Jul 2024 11:24:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46CBOwO1092648; Fri, 12 Jul 2024 11:24:58 GMT (envelope-from git) Date: Fri, 12 Jul 2024 11:24:58 GMT Message-Id: <202407121124.46CBOwO1092648@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: da0efbdb8d95 - main - ip6_output: place IPSEC_OUTPUT hook after the outgoing ifp is calculated 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: da0efbdb8d952a1e9d15a5e332149e1f1092f5d9 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=da0efbdb8d952a1e9d15a5e332149e1f1092f5d9 commit da0efbdb8d952a1e9d15a5e332149e1f1092f5d9 Author: Konstantin Belousov AuthorDate: 2023-01-25 11:03:51 +0000 Commit: Konstantin Belousov CommitDate: 2024-07-12 03:29:31 +0000 ip6_output: place IPSEC_OUTPUT hook after the outgoing ifp is calculated To be able to pass ifp and mtu to the ipsec_output() and ipsec accelerator filter. Sponsored by: NVIDIA networking Differential revision: https://reviews.freebsd.org/D44225 --- sys/netinet6/ip6_output.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index 68dd376af5d0..7eea64bb6344 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -449,27 +449,6 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt, #endif } -#if defined(IPSEC) || defined(IPSEC_SUPPORT) - /* - * IPSec checking which handles several cases. - * FAST IPSEC: We re-injected the packet. - * XXX: need scope argument. - */ - if (IPSEC_ENABLED(ipv6)) { - m = mb_unmapped_to_ext(m); - if (m == NULL) { - IP6STAT_INC(ip6s_odropped); - error = ENOBUFS; - goto bad; - } - if ((error = IPSEC_OUTPUT(ipv6, ifp, m, inp, mtu)) != 0) { - if (error == EINPROGRESS) - error = 0; - goto done; - } - } -#endif /* IPSEC */ - /* Source address validation. */ ip6 = mtod(m, struct ip6_hdr *); if (IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_src) && @@ -806,6 +785,27 @@ nonh6lookup: KASSERT((ifp != NULL), ("output interface must not be NULL")); KASSERT((origifp != NULL), ("output address interface must not be NULL")); +#if defined(IPSEC) || defined(IPSEC_SUPPORT) + /* + * IPSec checking which handles several cases. + * FAST IPSEC: We re-injected the packet. + * XXX: need scope argument. + */ + if (IPSEC_ENABLED(ipv6)) { + m = mb_unmapped_to_ext(m); + if (m == NULL) { + IP6STAT_INC(ip6s_odropped); + error = ENOBUFS; + goto bad; + } + if ((error = IPSEC_OUTPUT(ipv6, ifp, m, inp, mtu)) != 0) { + if (error == EINPROGRESS) + error = 0; + goto done; + } + } +#endif /* IPSEC */ + if ((flags & IPV6_FORWARDING) == 0) { /* XXX: the FORWARDING flag can be set for mrouting. */ in6_ifstat_inc(ifp, ifs6_out_request);