aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristof Provost <kp@FreeBSD.org>2024-09-11 07:13:21 +0000
committerKristof Provost <kp@FreeBSD.org>2024-09-25 10:44:34 +0000
commit6d51791d2832fb428b99d4c0ab22b392980bd27b (patch)
tree9f15910e27680e76184f7ca081f4603a4bf6874b
parent905db4aa88775865097714c170f4503da385747c (diff)
downloadsrc-6d51791d2832.tar.gz
src-6d51791d2832.zip
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
-rw-r--r--sys/netpfil/pf/pf_ioctl.c16
1 files 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));
}