Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Apr 2015 15:53:02 +0300
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        Kristof Provost <kp@FreeBSD.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r281536 - head/sys/netpfil/pf
Message-ID:  <20150415125302.GB883@FreeBSD.org>
In-Reply-To: <201504141907.t3EJ7bZp044696@svn.freebsd.org>
References:  <201504141907.t3EJ7bZp044696@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Apr 14, 2015 at 07:07:37PM +0000, Kristof Provost wrote:
K> Author: kp
K> Date: Tue Apr 14 19:07:37 2015
K> New Revision: 281536
K> URL: https://svnweb.freebsd.org/changeset/base/281536
K> 
K> Log:
K>   pf: Fix forwarding detection
K>   
K>   If the direction is not PF_OUT we can never be forwarding. Some input packets
K>   have rcvif != ifp (looped back packets), which lead us to ip6_forward() inbound
K>   packets, causing panics.
K>   
K>   Equally, we need to ensure that packets were really received and not locally
K>   generated before trying to ip6_forward() them.
K>   
K>   Differential Revision:	https://reviews.freebsd.org/D2286
K>   Approved by:		gnn(mentor)
K> 
K> Modified:
K>   head/sys/netpfil/pf/pf.c
K> 
K> Modified: head/sys/netpfil/pf/pf.c
K> ==============================================================================
K> --- head/sys/netpfil/pf/pf.c	Tue Apr 14 18:57:50 2015	(r281535)
K> +++ head/sys/netpfil/pf/pf.c	Tue Apr 14 19:07:37 2015	(r281536)
K> @@ -6070,7 +6070,7 @@ pf_test6(int dir, struct ifnet *ifp, str
K>  
K>  	M_ASSERTPKTHDR(m);
K>  
K> -	if (ifp != m->m_pkthdr.rcvif)
K> +	if (dir == PF_OUT && m->m_pkthdr.rcvif && ifp != m->m_pkthdr.rcvif)
K>  		fwdir = PF_FWD;

The ifp argument to pf_test6() is always not NULL, so the (m->m_pkthdr.rcvif)
conjunct is extraneous.

-- 
Totus tuus, Glebius.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150415125302.GB883>