svn commit: r212910 - stable/7/sys/contrib/pf/net

Bjoern A. Zeeb bz at FreeBSD.org
Mon Sep 20 18:26:37 UTC 2010


Author: bz
Date: Mon Sep 20 18:26:37 2010
New Revision: 212910
URL: http://svn.freebsd.org/changeset/base/212910

Log:
  MFC r212403:
  
    When using pf routing options, properly handle IP fragmentation
    for interfaces with TSO enabled, otherwise one would see an extra
    ICMP unreach, frag needed pre matching packet on lo0.
    This syncs pf code to ip_output.c r162084.
  
    Submitted by: yongari via mlaier
  
  PR:	kern/144311

Modified:
  stable/7/sys/contrib/pf/net/pf.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/contrib/pf/net/pf.c
==============================================================================
--- stable/7/sys/contrib/pf/net/pf.c	Mon Sep 20 18:20:35 2010	(r212909)
+++ stable/7/sys/contrib/pf/net/pf.c	Mon Sep 20 18:26:37 2010	(r212910)
@@ -6376,6 +6376,7 @@ pf_route(struct mbuf **m, struct pf_rule
 	m0->m_pkthdr.csum_flags &= ifp->if_hwassist;
 
 	if (ntohs(ip->ip_len) <= ifp->if_mtu ||
+	    (m0->m_pkthdr.csum_flags & ifp->if_hwassist & CSUM_TSO) != 0 ||
 	    (ifp->if_hwassist & CSUM_FRAGMENT &&
 		((ip->ip_off & htons(IP_DF)) == 0))) {
 		/*
@@ -6450,7 +6451,7 @@ pf_route(struct mbuf **m, struct pf_rule
 	 * Too large for interface; fragment if possible.
 	 * Must be able to put at least 8 bytes per fragment.
 	 */
-	if (ip->ip_off & htons(IP_DF)) {
+	if (ip->ip_off & htons(IP_DF) || (m0->m_pkthdr.csum_flags & CSUM_TSO)) {
 		ipstat.ips_cantfrag++;
 		if (r->rt != PF_DUPTO) {
 #ifdef __FreeBSD__


More information about the svn-src-stable-7 mailing list