diff options
author | eri <eri@FreeBSD.org> | 2014-11-19 13:31:08 +0000 |
---|---|---|
committer | eri <eri@FreeBSD.org> | 2014-11-19 13:31:08 +0000 |
commit | 0d0f5282c77d2a3c4c86cee3745c4c40b02b30d6 (patch) | |
tree | 129c630d6e982bc65359a2632d551a4bc7905e8d | |
parent | 3f5a0d0ab24e72151ca67518aabf58e6965764b9 (diff) | |
download | FreeBSD-src-0d0f5282c77d2a3c4c86cee3745c4c40b02b30d6.zip FreeBSD-src-0d0f5282c77d2a3c4c86cee3745c4c40b02b30d6.tar.gz |
pf(4) needs to have a correct checksum during its processing.
Calculate checksums for the IPv6 path when needed before
delving into pf(4) code as required.
PR: 172648, 179392
Reviewed by: glebius@
Approved by: gnn@
Obtained from: pfSense
MFC after: 1 week
Sponsored by: Netgate
-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 dba5674..213e49c 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -76,6 +76,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 @@ -3619,12 +3620,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); |