[CFT/Review] net byte order for AF_INET
Gleb Smirnoff
glebius at FreeBSD.org
Wed Oct 10 14:48:55 UTC 2012
On Wed, Oct 10, 2012 at 09:47:46AM -0500, Guy Helmer wrote:
G> > this is a patch that switches entire IPv4 stack to network
G> > byte order. That means, that at any layer any module should
G> > expect IP header in network byte order. Any host byte order
G> > values can be stored in local variables only and are never stored
G> > into a packet itself.
G> >
G> > The new code brings clarity, since a developer doesn't need to
G> > know which byte order should he/she switch a packet to when
G> > passing it to a particular function in stack. Also, any new
G> > function introduced should expect net byte order for a packet
G> > supplied.
G> >
G> > The patch has been tested by me on amd64 and ray@ on mips.
G> > TCP, UDP, ICMP, fragment reassembly and basic packet filtering
G> > works okay.
G> >
G> > More testing is desired, especially on boxes using some extensions
G> > as packet filters with policy routing, running gre(4), ipsec(4),
G> > divert(4), gif(4), multicast routing, stf(4), ng_ipfw(4), SCTP, etc.
G> >
G> > Code reviewing also appreciated.
G>
G> It's not obvious to me, so does this change the byte order expected in packets sent from userland via raw IP sockets?
This should not change.
--
Totus tuus, Glebius.
More information about the freebsd-net
mailing list