summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuiz Otavio O Souza <luiz@netgate.com>2016-11-01 14:51:39 -0500
committerLuiz Souza <luiz@netgate.com>2017-07-17 21:42:27 -0500
commit7a5cd904bd4806302959773754a39ee0fdc367a9 (patch)
tree72797f5b05d02d56976cc754ff6318ff9a78789f
parent75ab19628640040d122fe6c33ba0dfe5cde75694 (diff)
downloadFreeBSD-src-7a5cd904bd4806302959773754a39ee0fdc367a9.zip
FreeBSD-src-7a5cd904bd4806302959773754a39ee0fdc367a9.tar.gz
Fix a typo, check the return code from ipfw_dn_io() and simplify the code.
(cherry picked from commit 53775034bf00702f6c0a512bc44c72bff049060f)
-rw-r--r--sys/netpfil/pf/pf.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c
index 61cc864..f1b8b34 100644
--- a/sys/netpfil/pf/pf.c
+++ b/sys/netpfil/pf/pf.c
@@ -6498,7 +6498,7 @@ done:
pd.act.flags = s->state_flags;
} else if (r->dnpipe || r->pdnpipe) {
pd.act.dnpipe = r->dnpipe;
- pd.act.dnpipe = r->pdnpipe;
+ pd.act.pdnpipe = r->pdnpipe;
pd.act.flags = r->free_flags;
}
@@ -6532,21 +6532,19 @@ done:
if (s != NULL && s->nat_rule.ptr)
pf_packet_undo_nat(m, &pd, off, s, dir);
- ip_dn_io_ptr(m0,
- (dir == PF_IN) ? DIR_IN : DIR_OUT,
- &dnflow);
- /* This is dummynet fast io processing */
- if (*m0 != NULL) {
- m_tag_delete(*m0, m_tag_first(*m0));
- pd.pf_mtag->flags &= ~PF_PACKET_LOOPED;
- if (s != NULL && s->nat_rule.ptr)
- pf_packet_redo_nat(m, &pd, off, s, dir);
- } else {
- *m0 = NULL;
+ if (ip_dn_io_ptr(m0, (dir == PF_IN) ? DIR_IN : DIR_OUT,
+ &dnflow) != 0)
+ action = PF_DROP;
+ if (*m0 == NULL || action == PF_DROP) {
if (s)
PF_STATE_UNLOCK(s);
return (action);
}
+ /* This is dummynet fast io processing */
+ m_tag_delete(*m0, m_tag_first(*m0));
+ pd.pf_mtag->flags &= ~PF_PACKET_LOOPED;
+ if (s != NULL && s->nat_rule.ptr)
+ pf_packet_redo_nat(m, &pd, off, s, dir);
} else
pd.pf_mtag->flags &= ~PF_PACKET_LOOPED;
continueprocessing:
OpenPOWER on IntegriCloud