summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/ip6_ipsec.c
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2012-10-22 21:09:03 +0000
committerglebius <glebius@FreeBSD.org>2012-10-22 21:09:03 +0000
commit5cc3ac590262ed14bfbf8392f27f90923b7cc7a1 (patch)
tree6e8c53bf2442763edea3176e3bef68bfec20a183 /sys/netinet6/ip6_ipsec.c
parentaef46581d91a912fc587677321f83f81ce6df527 (diff)
downloadFreeBSD-src-5cc3ac590262ed14bfbf8392f27f90923b7cc7a1.zip
FreeBSD-src-5cc3ac590262ed14bfbf8392f27f90923b7cc7a1.tar.gz
Switch the entire IPv4 stack to keep the IP packet header
in network byte order. Any host byte order processing is done in local variables and host byte order values are never[1] written to a packet. After this change a packet processed by the stack isn't modified at all[2] except for TTL. After this change a network stack hacker doesn't need to scratch his head trying to figure out what is the byte order at the given place in the stack. [1] One exception still remains. The raw sockets convert host byte order before pass a packet to an application. Probably this would remain for ages for compatibility. [2] The ip_input() still subtructs header len from ip->ip_len, but this is planned to be fixed soon. Reviewed by: luigi, Maxim Dounin <mdounin mdounin.ru> Tested by: ray, Olivier Cochard-Labbe <olivier cochard.me>
Diffstat (limited to 'sys/netinet6/ip6_ipsec.c')
-rw-r--r--sys/netinet6/ip6_ipsec.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/sys/netinet6/ip6_ipsec.c b/sys/netinet6/ip6_ipsec.c
index b741cb1..f4e781e 100644
--- a/sys/netinet6/ip6_ipsec.c
+++ b/sys/netinet6/ip6_ipsec.c
@@ -289,15 +289,9 @@ 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