From owner-freebsd-ipfw Wed Oct 11 14: 4:28 2000 Delivered-To: freebsd-ipfw@freebsd.org Received: from whistle.com (s205m131.whistle.com [207.76.205.131]) by hub.freebsd.org (Postfix) with ESMTP id F0A0D37B503; Wed, 11 Oct 2000 14:04:25 -0700 (PDT) Received: (from smap@localhost) by whistle.com (8.10.0/8.10.0) id e9BL4PO28323; Wed, 11 Oct 2000 14:04:25 -0700 (PDT) Received: from bubba.whistle.com( 207.76.205.7) by whistle.com via smap (V2.0) id xma028318; Wed, 11 Oct 2000 14:04:24 -0700 Received: (from archie@localhost) by bubba.whistle.com (8.11.0/8.11.0) id e9BL4Oe54091; Wed, 11 Oct 2000 14:04:24 -0700 (PDT) (envelope-from archie) From: Archie Cobbs Message-Id: <200010112104.e9BL4Oe54091@bubba.whistle.com> Subject: Re: CFR: patch for bin/18351: ipfw add with no rule number returns the wrong rule number In-Reply-To: <20001011180742.A85291@sunbay.com> "from Ruslan Ermilov at Oct 11, 2000 06:07:42 pm" To: Ruslan Ermilov Date: Wed, 11 Oct 2000 14:04:24 -0700 (PDT) Cc: luigi@FreeBSD.ORG, ipfw@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL82 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-ipfw@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Ruslan Ermilov writes: > > Responsible-Changed-From-To: luigi->ru > > Responsible-Changed-By: ru > > Responsible-Changed-When: Wed Oct 11 07:40:11 PDT 2000 > > Responsible-Changed-Why: > > I have a working patch. > > > This patch simply changes the IP_FW_ADD sockopt from SOPT_SET to SOPT_GET, > thus allowing IPFW to return the assigned rule number back to userland in > case it was not specified explicitly. Does this patch look OK to you? Ugh.. 'get' is not exactly intuitive.. though I agree knowing the rule number is nice... I think instead of overloading 'get' (and breaking all user-land programs that do 'set') a better approach would be to add a new sockopt IP_FW_RULENUM that would retrieve the previously used 'automatic' rule number. This would be backward compatible and also more intuitive. > Do I need to bump the __FreeBSD_version or not? In any case, YES. -Archie ___________________________________________________________________________ Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ipfw" in the body of the message