bin/98349 [Re: cvs commit: src/sbin/ipfw ipfw2.c]

Luigi Rizzo rizzo at icir.org
Fri Jun 2 02:29:17 PDT 2006


On Fri, Jun 02, 2006 at 07:25:47AM +0200, Max Laier wrote:
> On Friday 02 June 2006 07:17, Max Laier wrote:
> > mlaier      2006-06-02 05:17:17 UTC
> >
> >   FreeBSD src repository
> >
> >   Modified files:
> >     sbin/ipfw            ipfw2.c
> >   Log:
> >   Print dynamic rules for IPv6 as well.
> >
> >   PR:             bin/98349
> >   Submitted by:   Mark Andrews
> >   MFC after:      2 weeks
> >
> >   Revision  Changes    Path
> >   1.90      +15 -5     src/sbin/ipfw/ipfw2.c
> 
> It's highly confusing that we have {src,dst}_{ip,port} in host byte order 

if i remember well, the design motivation behind this choice was that we
do range comparisons on ports and integer manipulation on the ipv4 addresses
(to apply masks and generate various indexes), so the most efficient choice
for the internal representation was host order. I'd rather keep it this way,
as we use these ops very very often, and not only performance but
even readability of the code would be impaired changing to network order.

> while {src,dst}_ip6 are in network byte order.  I think that keeping network 

As for ipv6 addresses there isn't really (yet ?) a native host support for 128-bit
operands so we could as well declare the network order to be the correct one
for native manipulation.

	cheers
	luigi


More information about the freebsd-ipfw mailing list