]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Switch the entire IPv4 stack to keep the IP packet header
authorglebius <glebius@FreeBSD.org>
Mon, 22 Oct 2012 21:09:03 +0000 (21:09 +0000)
committerglebius <glebius@FreeBSD.org>
Mon, 22 Oct 2012 21:09:03 +0000 (21:09 +0000)
commit5cc3ac590262ed14bfbf8392f27f90923b7cc7a1
tree6e8c53bf2442763edea3176e3bef68bfec20a183
parentaef46581d91a912fc587677321f83f81ce6df527
  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>
38 files changed:
UPDATING
sys/net/if_gre.c
sys/net/if_stf.c
sys/netgraph/ng_ipfw.c
sys/netinet/igmp.c
sys/netinet/in.h
sys/netinet/in_gif.c
sys/netinet/ip_carp.c
sys/netinet/ip_divert.c
sys/netinet/ip_gre.c
sys/netinet/ip_icmp.c
sys/netinet/ip_input.c
sys/netinet/ip_ipsec.c
sys/netinet/ip_mroute.c
sys/netinet/ip_options.c
sys/netinet/ip_output.c
sys/netinet/raw_ip.c
sys/netinet/sctp_input.c
sys/netinet/sctp_output.c
sys/netinet/sctp_usrreq.c
sys/netinet/sctputil.c
sys/netinet/siftr.c
sys/netinet/tcp_debug.c
sys/netinet/tcp_input.c
sys/netinet/tcp_output.c
sys/netinet/tcp_subr.c
sys/netinet/tcp_syncache.c
sys/netinet/tcp_timewait.c
sys/netinet/udp_usrreq.c
sys/netinet6/ip6_ipsec.c
sys/netipsec/ipsec.c
sys/netpfil/ipfw/ip_dn_io.c
sys/netpfil/ipfw/ip_fw2.c
sys/netpfil/ipfw/ip_fw_dynamic.c
sys/netpfil/ipfw/ip_fw_pfil.c
sys/netpfil/pf/if_pfsync.c
sys/netpfil/pf/pf.c
sys/sys/param.h