svn commit: r284577 - stable/10/sys/netpfil/pf

Kristof Provost kp at FreeBSD.org
Thu Jun 18 20:59:49 UTC 2015


Author: kp
Date: Thu Jun 18 20:59:48 2015
New Revision: 284577
URL: https://svnweb.freebsd.org/changeset/base/284577

Log:
  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

Modified:
  stable/10/sys/netpfil/pf/pf.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/netpfil/pf/pf.c
==============================================================================
--- stable/10/sys/netpfil/pf/pf.c	Thu Jun 18 20:57:21 2015	(r284576)
+++ stable/10/sys/netpfil/pf/pf.c	Thu Jun 18 20:59:48 2015	(r284577)
@@ -6078,7 +6078,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)


More information about the svn-src-all mailing list