From owner-cvs-all@FreeBSD.ORG Sun Sep 12 11:44:04 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C44B216A4CE; Sun, 12 Sep 2004 11:44:04 +0000 (GMT) Received: from xorpc.icir.org (xorpc.icir.org [192.150.187.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id A57EC43D3F; Sun, 12 Sep 2004 11:44:04 +0000 (GMT) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (localhost [127.0.0.1]) by xorpc.icir.org (8.12.9p1/8.12.8) with ESMTP id i8CBi2Ib048421; Sun, 12 Sep 2004 04:44:02 -0700 (PDT) (envelope-from rizzo@xorpc.icir.org) Received: (from rizzo@localhost) by xorpc.icir.org (8.12.9p1/8.12.3/Submit) id i8CBi2m1048420; Sun, 12 Sep 2004 04:44:02 -0700 (PDT) (envelope-from rizzo) Date: Sun, 12 Sep 2004 04:44:02 -0700 From: Luigi Rizzo To: John-Mark Gurney Message-ID: <20040912044402.B48362@xorpc.icir.org> References: <200409111944.i8BJiTe7005412@repoman.freebsd.org> <20040911235359.GC72089@funkthat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20040911235359.GC72089@funkthat.com>; from gurney_j@resnet.uoregon.edu on Sat, Sep 11, 2004 at 04:53:59PM -0700 cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: "Christian S.J. Peron" cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sbin/ipfw ipfw2.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Sep 2004 11:44:04 -0000 On Sat, Sep 11, 2004 at 04:53:59PM -0700, John-Mark Gurney wrote: > 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... because the other field is 6 not 8, plus the alignment i think is compiler dependent and the generated code not often very fast, and this stuff is in the critical path in the kernel. cheers luigi