git: 4d48dd689062 - main - pf: don't reject dummynet-ed packets

From: Kristof Provost <kp_at_FreeBSD.org>
Date: Fri, 06 May 2022 15:42:17 UTC
The branch main has been updated by kp:

URL: https://cgit.FreeBSD.org/src/commit/?id=4d48dd68906230f8c41caee6a5c9d7b9f272bdb1

commit 4d48dd68906230f8c41caee6a5c9d7b9f272bdb1
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2022-05-06 14:41:34 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2022-05-06 14:41:34 +0000

    pf: don't reject dummynet-ed packets
    
    If we pass a packet to dummynet we should indicate we've passed it (but
    keep m0 == NULL). Otherwise we'll indicate to the calling layers that
    the packet has been rejected.
    
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
---
 sys/netpfil/pf/pf.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c
index fd4031ac942c..e9185c4d8587 100644
--- a/sys/netpfil/pf/pf.c
+++ b/sys/netpfil/pf/pf.c
@@ -7298,9 +7298,7 @@ done:
 			if (pf_pdesc_to_dnflow(dir, &pd, r, s, &dnflow)) {
 				pd.pf_mtag->flags |= PF_TAG_DUMMYNET;
 				ip_dn_io_ptr(m0, &dnflow);
-				if (*m0 == NULL)
-					action = PF_DROP;
-				else
+				if (*m0 != NULL)
 					pd.pf_mtag->flags &= ~PF_TAG_DUMMYNET;
 			}
 		}
@@ -7758,9 +7756,7 @@ done:
 			if (pf_pdesc_to_dnflow(dir, &pd, r, s, &dnflow)) {
 				pd.pf_mtag->flags |= PF_TAG_DUMMYNET;
 				ip_dn_io_ptr(m0, &dnflow);
-				if (*m0 == NULL)
-					action = PF_DROP;
-				else
+				if (*m0 != NULL)
 					pd.pf_mtag->flags &= ~PF_TAG_DUMMYNET;
 			}
 		}