Re: [CFT/Review] net byte order for AF_INET

2012-10-14 Thread Adrian Chadd
.. sounds like the beginning of a wiki page to me, describing the mini project, the latest status and the latest patch. :) Adrian On 13 October 2012 11:32, Aleksandr Rybalko wrote: > Gleb Smirnoff написал(а): > >>On Fri, Oct 12, 2012 at 05:06:29PM -0400, Adrian Chadd wrote: >>A> On 12 Octobe

Re: [CFT/Review] net byte order for AF_INET

2012-10-13 Thread Aleksandr Rybalko
Gleb Smirnoff написал(а): >On Fri, Oct 12, 2012 at 05:06:29PM -0400, Adrian Chadd wrote: >A> On 12 October 2012 08:47, Gleb Smirnoff wrote: >A> > On Fri, Oct 12, 2012 at 04:46:40PM +0400, Gleb Smirnoff wrote: >A> > T> Latest version of patch for further review and testing >A> > T> Changelog: >

Re: [CFT/Review] net byte order for AF_INET

2012-10-12 Thread Gleb Smirnoff
On Fri, Oct 12, 2012 at 05:06:29PM -0400, Adrian Chadd wrote: A> On 12 October 2012 08:47, Gleb Smirnoff wrote: A> > On Fri, Oct 12, 2012 at 04:46:40PM +0400, Gleb Smirnoff wrote: A> > T> Latest version of patch for further review and testing A> > T> Changelog: A> > T> - Fixed TCP checksums A>

Re: [CFT/Review] net byte order for AF_INET

2012-10-12 Thread Adrian Chadd
On 12 October 2012 08:47, Gleb Smirnoff wrote: > On Fri, Oct 12, 2012 at 04:46:40PM +0400, Gleb Smirnoff wrote: > T> Latest version of patch for further review and testing > T> Changelog: > T> - Fixed TCP checksums > T> - Added comment about raw sockets byte ordering. > T> - More explicit hto

Re: [CFT/Review] net byte order for AF_INET

2012-10-12 Thread Gleb Smirnoff
On Fri, Oct 12, 2012 at 04:46:40PM +0400, Gleb Smirnoff wrote: T> Latest version of patch for further review and testing T> Changelog: T> - Fixed TCP checksums T> - Added comment about raw sockets byte ordering. T> - More explicit htons(0), when assigning ip_off field. Forgot attachment :( -

Re: [CFT/Review] net byte order for AF_INET

2012-10-12 Thread Gleb Smirnoff
Latest version of patch for further review and testing Changelog: - Fixed TCP checksums - Added comment about raw sockets byte ordering. - More explicit htons(0), when assigning ip_off field. -- Totus tuus, Glebius. ___ freebsd-net@freebsd.org mail

Re: [CFT/Review] net byte order for AF_INET

2012-10-12 Thread Gleb Smirnoff
On Fri, Oct 12, 2012 at 02:20:55AM +0200, Olivier Cochard-Labb? wrote: O> I've done some tests with this net byte ordered(NBO) patch: O> - I've compiled 2 i386 images of BSD Router Project (current branch O> rev241418): One with the patch, and the other without the patch [1] O> - I've run my "full-

Re: [CFT/Review] net byte order for AF_INET

2012-10-11 Thread Gleb Smirnoff
Olivier, thanks for help! On Fri, Oct 12, 2012 at 02:20:55AM +0200, Olivier Cochard-Labb? wrote: O> I've done some tests with this net byte ordered(NBO) patch: O> - I've compiled 2 i386 images of BSD Router Project (current branch O> rev241418): One with the patch, and the other without the p

Re: [CFT/Review] net byte order for AF_INET

2012-10-11 Thread Olivier Cochard-Labbé
I've done some tests with this net byte ordered(NBO) patch: - I've compiled 2 i386 images of BSD Router Project (current branch rev241418): One with the patch, and the other without the patch [1] - I've run my "full-features testing lab" under VirtualBox [2] using theses images. Here are the diffe

Re: [CFT/Review] net byte order for AF_INET

2012-10-11 Thread Gleb Smirnoff
On Thu, Oct 11, 2012 at 06:07:12AM +0400, Maxim Dounin wrote: M> > This is de facto standard for raw sockets in most OS-es. Byte order M> > in raw socket is host. And this is the same behavior we had before M> > the patch. So no reason for extra comments. M> M> As I already pointed out (in an off-

Re: [CFT/Review] net byte order for AF_INET

2012-10-10 Thread Maxim Dounin
Hello! On Thu, Oct 11, 2012 at 03:34:04AM +0400, Gleb Smirnoff wrote: [...] > This is de facto standard for raw sockets in most OS-es. Byte order > in raw socket is host. And this is the same behavior we had before > the patch. So no reason for extra comments. As I already pointed out (in an of

Re: [CFT/Review] net byte order for AF_INET

2012-10-10 Thread Gleb Smirnoff
On Thu, Oct 11, 2012 at 02:06:11AM +0200, Luigi Rizzo wrote: L> > M> > @@ -504,6 +504,9 @@ L> > M> > if (ip->ip_id == 0) L> > M> > ip->ip_id = ip_newid(); L> > M> > L> > M> > + ip->ip_len = htons(ip->ip_len); L> > M> > + ip->ip_off = hto

Re: [CFT/Review] net byte order for AF_INET

2012-10-10 Thread Luigi Rizzo
On Thu, Oct 11, 2012 at 03:34:04AM +0400, Gleb Smirnoff wrote: > Maxim, ... > M> > @@ -504,6 +504,9 @@ > M> > if (ip->ip_id == 0) > M> > ip->ip_id = ip_newid(); > M> > > M> > +ip->ip_len = htons(ip->ip_len); > M> > +ip->i

Re: [CFT/Review] net byte order for AF_INET

2012-10-10 Thread Gleb Smirnoff
Maxim, On Thu, Oct 11, 2012 at 02:26:51AM +0400, Maxim Dounin wrote: M> > --- sys/netinet/raw_ip.c (revision 241405) M> > +++ sys/netinet/raw_ip.c (working copy) M> > @@ -292,7 +292,7 @@ M> > * not modify the packet except for some M> > * byte order swaps. M> > */ M> > - ip->ip_

Re: [CFT/Review] net byte order for AF_INET

2012-10-10 Thread Maxim Dounin
Hello! On Wed, Oct 10, 2012 at 11:58:42PM +0400, Gleb Smirnoff wrote: > On Tue, Oct 09, 2012 at 07:41:28PM +0400, Gleb Smirnoff wrote: > T> this is a patch that switches entire IPv4 stack to network > T> byte order. That means, that at any layer any module should > T> expect IP header in networ

Re: [CFT/Review] net byte order for AF_INET

2012-10-10 Thread Luigi Rizzo
On Wed, Oct 10, 2012 at 10:31:43PM +0400, Gleb Smirnoff wrote: > Luigi, > > On Wed, Oct 10, 2012 at 02:46:37PM +0200, Luigi Rizzo wrote: > L> I am really grataful you are doing this. A few comments: ... > L> > Index: sys/netinet/raw_ip.c > L> > ===

Re: [CFT/Review] net byte order for AF_INET

2012-10-10 Thread Gleb Smirnoff
On Tue, Oct 09, 2012 at 07:41:28PM +0400, Gleb Smirnoff wrote: T> this is a patch that switches entire IPv4 stack to network T> byte order. That means, that at any layer any module should T> expect IP header in network byte order. Any host byte order T> values can be stored in local variables onl

Re: [CFT/Review] net byte order for AF_INET

2012-10-10 Thread Gleb Smirnoff
Luigi, On Wed, Oct 10, 2012 at 02:46:37PM +0200, Luigi Rizzo wrote: L> I am really grataful you are doing this. A few comments: L> L> + as a strategy, i would probably suggest (something you mostly seem to do already) L> that arithmetic comparisons (even if just for equality) always use the

Re: [CFT/Review] net byte order for AF_INET

2012-10-10 Thread John Baldwin
On Wednesday, October 10, 2012 4:56:11 am Gleb Smirnoff wrote: > On Wed, Oct 10, 2012 at 01:41:39AM -0700, Adrian Chadd wrote: > A> Can you please test on i386? :) > > I don't have any. If you have amd64 you have i386. You might even be able to test under virtualbox or the like. -- John Baldw

Re: [CFT/Review] net byte order for AF_INET

2012-10-10 Thread Gleb Smirnoff
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

Re: [CFT/Review] net byte order for AF_INET

2012-10-10 Thread Guy Helmer
On Oct 9, 2012, at 10:41 AM, Gleb Smirnoff wrote: > Hello, > > this is a patch that switches entire IPv4 stack to network > byte order. That means, that at any layer any module should > expect IP header in network byte order. Any host byte order > values can be stored in local variables only a

Re: [CFT/Review] net byte order for AF_INET

2012-10-10 Thread Luigi Rizzo
On Tue, Oct 09, 2012 at 07:41:28PM +0400, Gleb Smirnoff wrote: > Hello, > > this is a patch that switches entire IPv4 stack to network > byte order. That means, that at any layer any module should > expect IP header in network byte order. Any host byte order > values can be stored in local var

Re: [CFT/Review] net byte order for AF_INET

2012-10-10 Thread Gleb Smirnoff
On Wed, Oct 10, 2012 at 01:41:39AM -0700, Adrian Chadd wrote: A> Can you please test on i386? :) I don't have any. If you are hinting at debugging printf from in_cksum code that is present on i386 and not on amd64, then don't worry, I've added similar printf to amd64 in_cksum in my tree. -- Tot

Re: [CFT/Review] net byte order for AF_INET

2012-10-10 Thread Adrian Chadd
Can you please test on i386? :) Adrian On 9 October 2012 08:41, Gleb Smirnoff wrote: > Hello, > > this is a patch that switches entire IPv4 stack to network > byte order. That means, that at any layer any module should > expect IP header in network byte order. Any host byte order > values

[CFT/Review] net byte order for AF_INET

2012-10-09 Thread Gleb Smirnoff
Hello, this is a patch that switches entire IPv4 stack to network byte order. That means, that at any layer any module should expect IP header in network byte order. Any host byte order values can be stored in local variables only and are never stored into a packet itself. The new code brin