diff options
author | glebius <glebius@FreeBSD.org> | 2015-01-23 18:15:15 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2015-01-23 18:15:15 +0000 |
commit | 52282183c024ecefb2d2c52eabdd2ba0cb1dc0ed (patch) | |
tree | eaaecb6d4d83513841f589e5f01f1546afd59092 | |
parent | 049d5b632da1d4a801887c08520543f259cf7c17 (diff) | |
download | FreeBSD-src-52282183c024ecefb2d2c52eabdd2ba0cb1dc0ed.zip FreeBSD-src-52282183c024ecefb2d2c52eabdd2ba0cb1dc0ed.tar.gz |
Merge r274709 by eri@: deal with IPv6 same way as we IPv4 and calculate
the checksum before entering pf_test6().
PR: 172648, 179392
-rw-r--r-- | sys/netpfil/pf/pf_ioctl.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 260c52e..c9dc40e 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -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, struct ifnet *ifp, int dir, 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); |