From owner-svn-src-projects@FreeBSD.ORG Sat Oct 11 20:13:09 2014 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0CC95D6B; Sat, 11 Oct 2014 20:13:09 +0000 (UTC) Received: from mail.ipfw.ru (mail.ipfw.ru [IPv6:2a01:4f8:120:6141::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0B58272; Sat, 11 Oct 2014 20:13:08 +0000 (UTC) Received: from secured.by.ipfw.ru ([95.143.220.47] helo=[10.0.0.120]) by mail.ipfw.ru with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.82 (FreeBSD)) (envelope-from ) id 1Xcz2f-000CSn-IY; Sat, 11 Oct 2014 19:57:13 +0400 Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r272515 - projects/ipfw/sys/netpfil/ipfw From: "Alexander V. Chernikov" In-Reply-To: <201410091711.28587.jhb@freebsd.org> Date: Sun, 12 Oct 2014 00:13:00 +0400 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201410041210.s94CAX7I012628@svn.freebsd.org> <5520708.eFNh9vYom7@ralph.baldwin.cx> <5436B52E.3010106@FreeBSD.org> <201410091711.28587.jhb@freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-projects@freebsd.org, src-committers@freebsd.org, "Alexander V. Chernikov" X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Oct 2014 20:13:09 -0000 On 10 Oct 2014, at 01:11, John Baldwin wrote: > On Thursday, October 09, 2014 12:17:50 pm Alexander V. Chernikov = wrote: >> On 06.10.2014 19:45, John Baldwin wrote: >>> On Saturday, October 04, 2014 12:10:33 PM Alexander V. Chernikov = wrote: >>>> Author: melifaro >>>> Date: Sat Oct 4 12:10:32 2014 >>>> New Revision: 272515 >>>> URL: https://svnweb.freebsd.org/changeset/base/272515 >>>>=20 >>>> Log: >>>> Add "ipfw_ctl3" FEATURE to indicate presence of new ipfw = interface. >>>>=20 >>>> Modified: >>>> projects/ipfw/sys/netpfil/ipfw/ip_fw2.c >>>>=20 >>>> Modified: projects/ipfw/sys/netpfil/ipfw/ip_fw2.c >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D >>>> =3D=3D --- projects/ipfw/sys/netpfil/ipfw/ip_fw2.c Sat Oct 4 = 11:40:35 >>>> 2014 (r272514) +++ projects/ipfw/sys/netpfil/ipfw/ip_fw2.c = Sat Oct 4 >>>> 12:10:32 2014 (r272515) @@ -2874,6 +2874,7 @@ static = moduledata_t ipfwmod =3D >>>> { >>>> #define IPFW_VNET_ORDER (IPFW_MODEVENT_ORDER + 2) /* = Later still. */ >>>>=20 >>>> DECLARE_MODULE(ipfw, ipfwmod, IPFW_SI_SUB_FIREWALL, = IPFW_MODEVENT_ORDER); >>>> +FEATURE(ipfw_ctl3, "ipfw new sockopt calls"); >>>> MODULE_VERSION(ipfw, 2); >>>> /* should declare some dependencies here */ >>> Would it be better to bump the module version to 3 instead? = Userland programs >>> can then use modfind() and modstat() to determine the version. >> I've bumped ipfw module version in r272828. Actually, I've entirely=20= >> forgotten about this possibility. >> However, it is a bit hard to determine module version inside=20 >> (perl|python|sh|any) script. >> On the other case, FEATURE framework provides nice and easy way to=20 >> determine any "feature" status >> both in C and interpreted programs. >=20 > I'll grant you that feature is convenient. Perhaps create a SYSCTL = node though that > holds the current version? That is 'foo.ipfw.version' being 2 or 3 is = more future > proof than 'feature.ipfw2/3/4=92. No, this is not about new _ipfw_ version. I=92m unsure if all these = changes are large enough to name ipfw as =93ipfw3=94. This is just an indication that all ipfw-related = sockopts are available via single setsockopt called IP_FW3. Maybe naming is not the best - I=92m open to any suggestion.=20 However, I=92m not sure why should I invent additional sysctls instead = of using standard interface. >=20 > Alternatively, we could change the module code to export a dynamic = sysctl tree > for all loaded modules that includes the versions, i.e. = 'module..version', etc. >=20 > --=20 > John Baldwin >=20