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> > ===================================================================
> L> > --- sys/netinet/raw_ip.c (revision 241370)
> L> > +++ sys/netinet/raw_ip.c (working copy)
> L> > @@ -292,6 +292,7 @@
> L> >           * not modify the packet except for some
> L> >           * byte order swaps.
> L> >           */
> L> > +        ip->ip_len = ntohs(ip->ip_len);
> L> >          ip->ip_len += off;
> L> >  
> L> >          hash = INP_PCBHASH_RAW(proto, ip->ip_src.s_addr,
> L> 
> L> this seems wrong, perhaps you want
> L> 
> L> -          ip->ip_len += off;
> L> +  ip->ip_len = htons(ntohs(ip->ip_len) + off);
> 
> Maxim Dounin also noticed this. This was done intentionally, but since two
> people are in doubt, I will look closer here. Historically BSD had supplied
> host byte order in raw sockets, but I suppose, for head/ this is no longer
> true for about a year.

I was not aware of that. Then please add a comment either mentioning
that the behaviour differs from historical, or that the packet format
differs from the (new) standard kernel format in this particular case.


cheers
luigi
_______________________________________________
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"

Reply via email to