Date: Tue, 14 Apr 2015 19:07:37 +0000 (UTC) From: Kristof Provost <kp@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281536 - head/sys/netpfil/pf Message-ID: <201504141907.t3EJ7bZp044696@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kp Date: Tue Apr 14 19:07:37 2015 New Revision: 281536 URL: https://svnweb.freebsd.org/changeset/base/281536 Log: 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) Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Tue Apr 14 18:57:50 2015 (r281535) +++ head/sys/netpfil/pf/pf.c Tue Apr 14 19:07:37 2015 (r281536) @@ -6070,7 +6070,7 @@ pf_test6(int dir, struct ifnet *ifp, str 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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201504141907.t3EJ7bZp044696>