From owner-freebsd-ipfw Thu Oct 12 0:50:42 2000 Delivered-To: freebsd-ipfw@freebsd.org Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65]) by hub.freebsd.org (Postfix) with ESMTP id 340E237B66D; Thu, 12 Oct 2000 00:50:35 -0700 (PDT) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.11.0/8.11.0) id e9C7oQW13280; Thu, 12 Oct 2000 10:50:26 +0300 (EEST) (envelope-from ru) Date: Thu, 12 Oct 2000 10:50:26 +0300 From: Ruslan Ermilov To: Archie Cobbs Cc: luigi@FreeBSD.ORG, ipfw@FreeBSD.ORG Subject: Re: CFR: patch for bin/18351: ipfw add with no rule number returns the wrong rule number Message-ID: <20001012105026.A12636@sunbay.com> Mail-Followup-To: Archie Cobbs , luigi@FreeBSD.ORG, ipfw@FreeBSD.ORG References: <20001011180742.A85291@sunbay.com> <200010112104.e9BL4Oe54091@bubba.whistle.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200010112104.e9BL4Oe54091@bubba.whistle.com>; from archie@whistle.com on Wed, Oct 11, 2000 at 02:04:24PM -0700 Sender: owner-freebsd-ipfw@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, Oct 11, 2000 at 02:04:24PM -0700, Archie Cobbs wrote: > 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. > I instead have decided to allow for IP_FW_ADD to be used in both setsockopt(2) and getsockopt(2). In setsockopt() case we behave like it was before. In getsockopt() case we additionally return the rule back into userland, and it is backwards compatible. > > Do I need to bump the __FreeBSD_version or not? > > In any case, YES. > Don't you think that 420000 would be appropriate in this case, assuming I will MFC this before 4.2-RELEASE? -- Ruslan Ermilov Oracle Developer/DBA, ru@sunbay.com Sunbay Software AG, ru@FreeBSD.org FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ipfw" in the body of the message