summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuiz Otavio O Souza <luiz@netgate.com>2017-01-08 13:24:51 -0600
committerLuiz Souza <luiz@netgate.com>2017-07-17 21:46:40 -0500
commit34a1694802ca6f9800e3acc36c422a6dfc5de73b (patch)
treee75b2ea65667ce070d3a4a6a93efa762aa092ad6
parentdb510ad553807b1f3c37ed7f55ac752879ff341b (diff)
downloadFreeBSD-src-34a1694802ca6f9800e3acc36c422a6dfc5de73b.zip
FreeBSD-src-34a1694802ca6f9800e3acc36c422a6dfc5de73b.tar.gz
Always return PF_PASS for packets processed by dummynet, even if dummynet drop the packet. While it even works for forwarded packets it will close the connection for a local bound sockets.
Ticket #7050 (cherry picked from commit 4c908ee9021b280805f8f240274e7cb06bba80db)
-rw-r--r--sys/netpfil/pf/pf.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c
index b8ebdc5..3a741ee 100644
--- a/sys/netpfil/pf/pf.c
+++ b/sys/netpfil/pf/pf.c
@@ -6454,7 +6454,8 @@ done:
/* XXX: ipfw has the same behaviour! */
action = PF_DROP;
REASON_SET(&reason, PFRES_MEMORY);
- } else if ((pd.act.dnpipe || pd.act.pdnpipe) && !PACKET_LOOPED(&pd)) {
+ } else if (action == PF_PASS &&
+ (pd.act.dnpipe || pd.act.pdnpipe) && !PACKET_LOOPED(&pd)) {
if (dir != r->direction && pd.act.pdnpipe) {
dnflow.rule.info = pd.act.pdnpipe;
} else if (dir == r->direction) {
@@ -6490,9 +6491,7 @@ done:
if (s != NULL && s->nat_rule.ptr)
PACKET_UNDO_NAT(m, &pd, off, s, dir);
- if (ip_dn_io_ptr(m0, (dir == PF_IN) ? DIR_IN : DIR_OUT,
- &dnflow) != 0)
- action = PF_DROP;
+ ip_dn_io_ptr(m0, (dir == PF_IN) ? DIR_IN : DIR_OUT, &dnflow);
if (*m0 == NULL) {
if (s)
PF_STATE_UNLOCK(s);
OpenPOWER on IntegriCloud