From nobody Wed Sep 25 12:34:29 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 4XDGPy26W9z5XQZp; Wed, 25 Sep 2024 12:34:30 +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 4XDGPy0XkZz4vrS; Wed, 25 Sep 2024 12:34:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727267670; 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=KPqLjEwDW4a/PPGtcwTXx8V7YpEJ7AfbMVlpAJmcSGc=; b=c7Q5j7xoN3e5kzbLD1ajzEYuV8vMVvaEsFTh3gTHgM7AKfiKZkEGW6rZ5GQlb5f3iL3k/n 8OEDfo3pAOgYX0kisyUrFHk5tRHsQXasS3vgmRoSir9kJQszutvQQ3iaEbznHw4g7xP6Ok PeEcLO1oDccOVaoQLwSoOSCi7nHw/c8VAtJqpuGjYhSMjqWb2ooS87Hedh0jBDmEa2+Ql9 ZdMhZfG9NQ9rRDEaFGIwVXDbHLXOR6I7HiulFuBg1ORLA7t7SgoThsqaVFZZPcpFadqGY3 IN2iGlbiqKCk34ZIOqtJL3f5ozuvlHtpfTsyQFocDMEImYLS8xFvNJlcZkHR/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727267670; 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=KPqLjEwDW4a/PPGtcwTXx8V7YpEJ7AfbMVlpAJmcSGc=; b=ozjBXfpA8bZcLKBS3xVjQju/Aqme1ZJMfvYp41YPSGGYh2PLUxyGTgnh+pLm0eBFL3gxi/ XjLNGpKTHidYqhSaNztHDJU1vjn809CAYGVzXCMRvs79RblfdUM69zGTNbOYdMeZ+bMrs+ vP8++cI4kXuCRzHJ88emg9bDvf0UqLBgLom0ddwO0rdBVLSuA0gZckdp+F4CNrhF6yZ5tR rpH+YBSEQe633mgedUwE2okASPkaZnG1HDNJa5xmcXKkBXWpBpw4j3F4SHwaXAMQEq+nxF vhcOzacCQxrmN9oAQL3vOih/+y8ECXM9rwyB5a7WzIdVoxxjNs8vflg8uOpkEA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727267670; a=rsa-sha256; cv=none; b=YMILcYITIdKts//dDrywWM6K6t/u+Rxk6/AmJQJ1F1wXZ2Bk+Zs2DhDhbyYOhivxuUcBP4 eDavcAcYnZZtMmIidJR41XGcgQqMStH0gkFQeeQPacnr43FFhxpjCkw6oS35MccIiR9Vr5 SdpCg0mIrNP2M/6swqjEWKVHyzPG/AhdK4DrkeuYUnR9pZFUzKm9hQDH/yRBIfTfWFntS6 NaG5Z1GHeVcl4huStEMQX37X7KlwFVsGlMRs37+uJpmX0G1utRQ4KPZKUFQUKNicFW0nfW v+QdUJtegVcmYMR83e1WpsI/7vJL9O1TMlfPRO3Sei1rD9YzwbevuNsWSLknAw== 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 4XDGPy06l3z1CX4; Wed, 25 Sep 2024 12:34:30 +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 48PCYTDi071725; Wed, 25 Sep 2024 12:34:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48PCYTwC071722; Wed, 25 Sep 2024 12:34:29 GMT (envelope-from git) Date: Wed, 25 Sep 2024 12:34:29 GMT Message-Id: <202409251234.48PCYTwC071722@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 6d51791d2832 - main - pf: remove pointless CURVNET_SET 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: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6d51791d2832fb428b99d4c0ab22b392980bd27b Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=6d51791d2832fb428b99d4c0ab22b392980bd27b commit 6d51791d2832fb428b99d4c0ab22b392980bd27b Author: Kristof Provost AuthorDate: 2024-09-11 07:13:21 +0000 Commit: Kristof Provost CommitDate: 2024-09-25 10:44:34 +0000 pf: remove pointless CURVNET_SET We're already in the correct vnet when the pfil hook is called. Remove the pointless set/restore. Reviewed by: glebius, zlei Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46648 --- sys/netpfil/pf/pf_ioctl.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index e205c5ca0c38..dcdab6029558 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -6442,6 +6442,8 @@ pf_eth_check_in(struct mbuf **m, struct ifnet *ifp, int flags, { int chk; + CURVNET_ASSERT_SET(); + chk = pf_test_eth(PF_IN, flags, ifp, m, inp); return (pf_check_return(chk, m)); @@ -6453,6 +6455,8 @@ pf_eth_check_out(struct mbuf **m, struct ifnet *ifp, int flags, { int chk; + CURVNET_ASSERT_SET(); + chk = pf_test_eth(PF_OUT, flags, ifp, m, inp); return (pf_check_return(chk, m)); @@ -6465,6 +6469,8 @@ pf_check_in(struct mbuf **m, struct ifnet *ifp, int flags, { int chk; + CURVNET_ASSERT_SET(); + chk = pf_test(PF_IN, flags, ifp, m, inp, NULL); return (pf_check_return(chk, m)); @@ -6476,6 +6482,8 @@ pf_check_out(struct mbuf **m, struct ifnet *ifp, int flags, { int chk; + CURVNET_ASSERT_SET(); + chk = pf_test(PF_OUT, flags, ifp, m, inp, NULL); return (pf_check_return(chk, m)); @@ -6489,15 +6497,15 @@ pf_check6_in(struct mbuf **m, struct ifnet *ifp, int flags, { int chk; + CURVNET_ASSERT_SET(); + /* * In case of loopback traffic IPv6 uses the real interface in * order to support scoped addresses. In order to support stateful * filtering we have change this to lo0 as it is the case in IPv4. */ - CURVNET_SET(ifp->if_vnet); chk = pf_test6(PF_IN, flags, (*m)->m_flags & M_LOOP ? V_loif : ifp, m, inp, NULL); - CURVNET_RESTORE(); return (pf_check_return(chk, m)); } @@ -6508,9 +6516,9 @@ pf_check6_out(struct mbuf **m, struct ifnet *ifp, int flags, { int chk; - CURVNET_SET(ifp->if_vnet); + CURVNET_ASSERT_SET(); + chk = pf_test6(PF_OUT, flags, ifp, m, inp, NULL); - CURVNET_RESTORE(); return (pf_check_return(chk, m)); }