Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Sep 2004 16:53:59 -0700
From:      John-Mark Gurney <gurney_j@resnet.uoregon.edu>
To:        "Christian S.J. Peron" <csjp@FreeBSD.org>
Cc:        cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sbin/ipfw ipfw2.c
Message-ID:  <20040911235359.GC72089@funkthat.com>
In-Reply-To: <200409111944.i8BJiTe7005412@repoman.freebsd.org>
References:  <200409111944.i8BJiTe7005412@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Christian S.J. Peron wrote this message on Sat, Sep 11, 2004 at 19:44 +0000:
>   Currently when ipfw(8) generates the micro-instructions for rules which
>   contain O_UID, O_GID and O_JAIL opcodes, the F_NOT or F_OR logical
>   operator bits get clobbered. Making it impossible to use the ``NOT'' or
>   ``OR'' operators with uid, gid and jail based constraints.
>   
>   The ipfw_insn instruction template contains a ``len'' element which
>   stores two pieces of information, the size of the instruction
>   (in 32-bit words) in the low 6 bits of "len" with the 2 remaining
>   bits to implement OR and NOT.

Why don't we use the bit field?
	u_int8_t	logic : 2;
	u_int8_t	len : 8;

considering this is already used by the enum..  It'd make bugs like
these less likely...

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."


Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040911235359.GC72089>