Skip to content

Commit

Permalink
Always return PF_PASS for packets processed by dummynet, even if dumm…
Browse files Browse the repository at this point in the history
…ynet drop the packet. While it even works for forwarded packets it will close the connection for a local bound sockets.

Ticket #7050
  • Loading branch information
loos-br committed Jan 8, 2017
1 parent 994e779 commit 4c908ee
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions sys/netpfil/pf/pf.c
Original file line number Diff line number Diff line change
Expand Up @@ -6442,7 +6442,8 @@ pf_test(int dir, struct ifnet *ifp, struct mbuf **m0, struct inpcb *inp)
/* 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) {
Expand Down Expand Up @@ -6478,9 +6479,7 @@ pf_test(int dir, struct ifnet *ifp, struct mbuf **m0, struct inpcb *inp)
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);
Expand Down

0 comments on commit 4c908ee

Please sign in to comment.