Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Oct 2000 10:50:26 +0300
From:      Ruslan Ermilov <ru@FreeBSD.ORG>
To:        Archie Cobbs <archie@whistle.com>
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>
In-Reply-To: <200010112104.e9BL4Oe54091@bubba.whistle.com>; from archie@whistle.com on Wed, Oct 11, 2000 at 02:04:24PM -0700
References:  <20001011180742.A85291@sunbay.com> <200010112104.e9BL4Oe54091@bubba.whistle.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




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