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);
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to