From 5cc3ac590262ed14bfbf8392f27f90923b7cc7a1 Mon Sep 17 00:00:00 2001 From: glebius Date: Mon, 22 Oct 2012 21:09:03 +0000 Subject: 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 Tested by: ray, Olivier Cochard-Labbe --- sys/netinet6/ip6_ipsec.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'sys/netinet6/ip6_ipsec.c') 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 -- cgit v1.1