Date: Wed, 10 Oct 2012 18:48:52 +0400 From: Gleb Smirnoff <glebius@FreeBSD.org> To: Guy Helmer <guy.helmer@gmail.com> Cc: net@FreeBSD.org Subject: Re: [CFT/Review] net byte order for AF_INET Message-ID: <20121010144852.GD34622@glebius.int.ru> In-Reply-To: <E52E22DC-6BE0-40E7-AB9B-10375DD301AE@gmail.com> References: <20121009154128.GU34622@FreeBSD.org> <E52E22DC-6BE0-40E7-AB9B-10375DD301AE@gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20121010144852.GD34622>