Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Jan 2015 18:15:16 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r277581 - stable/10/sys/netpfil/pf
Message-ID:  <201501231815.t0NIFGUR015753@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Fri Jan 23 18:15:15 2015
New Revision: 277581
URL: https://svnweb.freebsd.org/changeset/base/277581

Log:
  Merge r274709 by eri@: deal with IPv6 same way as we IPv4 and calculate
  the checksum before entering pf_test6().
  
  PR:		172648, 179392

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

Modified: stable/10/sys/netpfil/pf/pf_ioctl.c
==============================================================================
--- stable/10/sys/netpfil/pf/pf_ioctl.c	Fri Jan 23 18:14:29 2015	(r277580)
+++ stable/10/sys/netpfil/pf/pf_ioctl.c	Fri Jan 23 18:15:15 2015	(r277581)
@@ -72,6 +72,7 @@ __FBSDID("$FreeBSD$");
 #include <netinet/in.h>
 #include <netinet/ip.h>
 #include <netinet/ip_var.h>
+#include <netinet6/ip6_var.h>
 #include <netinet/ip_icmp.h>
 
 #ifdef INET6
@@ -3616,12 +3617,11 @@ pf_check6_out(void *arg, struct mbuf **m
 	int chk;
 
 	/* We need a proper CSUM before we start (s. OpenBSD ip_output) */
-	if ((*m)->m_pkthdr.csum_flags & CSUM_DELAY_DATA) {
-#ifdef INET
-		/* XXX-BZ copy&paste error from r126261? */
-		in_delayed_cksum(*m);
-#endif
-		(*m)->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA;
+	if ((*m)->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6) {
+		in6_delayed_cksum(*m,
+		    (*m)->m_pkthdr.len - sizeof(struct ip6_hdr),
+		    sizeof(struct ip6_hdr));
+		(*m)->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA_IPV6;
 	}
 	CURVNET_SET(ifp->if_vnet);
 	chk = pf_test6(PF_OUT, ifp, m, inp);



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