Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Nov 2014 12:38:28 +0100
From:      =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
To:        Ermal LuXXi <eri@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r274709 - head/sys/netpfil/pf
Message-ID:  <86ioi3y0gb.fsf@nine.des.no>
In-Reply-To: <86ppcbvb04.fsf@nine.des.no> ("Dag-Erling =?utf-8?Q?Sm=C3=B8r?= =?utf-8?Q?grav=22's?= message of "Tue, 25 Nov 2014 11:18:51 %2B0100")
References:  <201411191331.sAJDV9bH092190@svn.freebsd.org> <86tx1nvcy4.fsf@nine.des.no> <86ppcbvb04.fsf@nine.des.no>

next in thread | previous in thread | raw e-mail | index | archive | help
Here's a patch that doesn't crash and tries not to break TSO.

Index: sys/netpfil/pf/pf_ioctl.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- sys/netpfil/pf/pf_ioctl.c	(revision 274791)
+++ sys/netpfil/pf/pf_ioctl.c	(working copy)
@@ -3576,9 +3576,10 @@
 	int chk;
=20
 	/* We need a proper CSUM befor we start (s. OpenBSD ip_output) */
-	if ((*m)->m_pkthdr.csum_flags & CSUM_DELAY_DATA) {
+	if ((*m)->m_pkthdr.csum_flags &
+	    ((CSUM_DELAY_IP|CSUM_DELAY_DATA) & ~ifp->if_hwassist)) {
 		in_delayed_cksum(*m);
-		(*m)->m_pkthdr.csum_flags &=3D ~CSUM_DELAY_DATA;
+		(*m)->m_pkthdr.csum_flags &=3D ~(CSUM_DELAY_IP|CSUM_DELAY_DATA);
 	}
=20
 	chk =3D pf_test(PF_OUT, ifp, m, inp);
@@ -3620,12 +3621,14 @@
 	int chk;
=20
 	/* We need a proper CSUM before we start (s. OpenBSD ip_output) */
-	if ((*m)->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6) {
+	if ((*m)->m_pkthdr.csum_flags &
+	    (CSUM_DELAY_DATA_IPV6 & ~ifp->if_hwassist)) {
 		in6_delayed_cksum(*m,
 		    (*m)->m_pkthdr.len - sizeof(struct ip6_hdr),
 		    sizeof(struct ip6_hdr));
 		(*m)->m_pkthdr.csum_flags &=3D ~CSUM_DELAY_DATA_IPV6;
 	}
+
 	CURVNET_SET(ifp->if_vnet);
 	chk =3D pf_test6(PF_OUT, ifp, m, inp);
 	CURVNET_RESTORE();

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no



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