summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/ip6_ipsec.c
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2012-10-08 08:03:58 +0000
committerglebius <glebius@FreeBSD.org>2012-10-08 08:03:58 +0000
commit9086143e8c44d2b1e0e51b8ec7ca16698d37dc15 (patch)
treeed251f6dc49084fa197a5fcd1cfd8cde5bf56695 /sys/netinet6/ip6_ipsec.c
parent5ab12d2aed81a42842ab0cda5a1843c0e23fb249 (diff)
downloadFreeBSD-src-9086143e8c44d2b1e0e51b8ec7ca16698d37dc15.zip
FreeBSD-src-9086143e8c44d2b1e0e51b8ec7ca16698d37dc15.tar.gz
After r241245 it appeared that in_delayed_cksum(), which still expects
host byte order, was sometimes called with net byte order. Since we are moving towards net byte order throughout the stack, the function was converted to expect net byte order, and its consumers fixed appropriately: - ip_output(), ipfilter(4) not changed, since already call in_delayed_cksum() with header in net byte order. - divert(4), ng_nat(4), ipfw_nat(4) now don't need to swap byte order there and back. - mrouting code and IPv6 ipsec now need to switch byte order there and back, but I hope, this is temporary solution. - In ipsec(4) shifted switch to net byte order prior to in_delayed_cksum(). - pf_route() catches up on r241245 changes to ip_output().
Diffstat (limited to 'sys/netinet6/ip6_ipsec.c')
-rw-r--r--sys/netinet6/ip6_ipsec.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/netinet6/ip6_ipsec.c b/sys/netinet6/ip6_ipsec.c
index 911ea8d..5d214dea 100644
--- a/sys/netinet6/ip6_ipsec.c
+++ b/sys/netinet6/ip6_ipsec.c
@@ -295,9 +295,15 @@ ip6_ipsec_output(struct mbuf **m, struct inpcb *inp, int *flags, int *error,
*/
#ifdef INET
if ((*m)->m_pkthdr.csum_flags & CSUM_DELAY_DATA) {
+ struct ip *ip;
+
ipseclog((LOG_DEBUG,
"%s: we do not support IPv4 over IPv6", __func__));
+ /* XXX: in_delayed_cksum() expects net byte order */
+ ip = mtod(m, struct ip *);
+ ip->ip_len = htons(ip->ip_len);
in_delayed_cksum(*m);
+ ip->ip_len = ntohs(ip->ip_len);
(*m)->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA;
}
#endif
OpenPOWER on IntegriCloud