diff options
author | kp <kp@FreeBSD.org> | 2015-04-14 19:07:37 +0000 |
---|---|---|
committer | kp <kp@FreeBSD.org> | 2015-04-14 19:07:37 +0000 |
commit | 859bfca800e5145ce38320a0daf23a3b391089a2 (patch) | |
tree | 2a506c2922823dfde78b09a062c1c509592146cc /sys/netpfil | |
parent | 8c6f9cd4e591e757fda58ad59ba597f6ca78cffe (diff) | |
download | FreeBSD-src-859bfca800e5145ce38320a0daf23a3b391089a2.zip FreeBSD-src-859bfca800e5145ce38320a0daf23a3b391089a2.tar.gz |
pf: Fix forwarding detection
If the direction is not PF_OUT we can never be forwarding. Some input packets
have rcvif != ifp (looped back packets), which lead us to ip6_forward() inbound
packets, causing panics.
Equally, we need to ensure that packets were really received and not locally
generated before trying to ip6_forward() them.
Differential Revision: https://reviews.freebsd.org/D2286
Approved by: gnn(mentor)
Diffstat (limited to 'sys/netpfil')
-rw-r--r-- | sys/netpfil/pf/pf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index ce0c6bd..6d24634 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -6070,7 +6070,7 @@ pf_test6(int dir, struct ifnet *ifp, struct mbuf **m0, struct inpcb *inp) M_ASSERTPKTHDR(m); - if (ifp != m->m_pkthdr.rcvif) + if (dir == PF_OUT && m->m_pkthdr.rcvif && ifp != m->m_pkthdr.rcvif) fwdir = PF_FWD; if (!V_pf_status.running) |