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->ip_off = htons(ip->ip_off);
> M> > +
> M> 
> M> So the packet is expected to come into rip_output() from caller 
> M> with ip_len/ip_off in host byte order, right?  As already 
> M> suggested - it would be good to add a comment explaining this.
> 
> 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.

??? just the fact that there was a debate on this item is sufficient
ground for commenting it. The fact that this is (presumably) one
of the only two places (in and out on raw IP sockets ?) where
ip_len and ip_off are in host format is another good reason
to comment both instances.

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