diff options
author | kp <kp@FreeBSD.org> | 2015-06-18 20:59:48 +0000 |
---|---|---|
committer | kp <kp@FreeBSD.org> | 2015-06-18 20:59:48 +0000 |
commit | 7602db847b7820a651918f47a72aec1ab5f309e6 (patch) | |
tree | 5500b708f1bc3e2c6e94cc8868b581ca20933039 /sys/netpfil | |
parent | 1af840c38ec20bb93f4838a45f3df0e34d6c5660 (diff) | |
download | FreeBSD-src-7602db847b7820a651918f47a72aec1ab5f309e6.zip FreeBSD-src-7602db847b7820a651918f47a72aec1ab5f309e6.tar.gz |
Merge r281536
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/D2822
Reviewed by: gnn
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 856bffb..db33e20 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -6078,7 +6078,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) |