From owner-freebsd-ipfw@FreeBSD.ORG Fri Jan 7 12:32:00 2005 Return-Path: Delivered-To: freebsd-ipfw@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 86D5E16A4CE for ; Fri, 7 Jan 2005 12:32:00 +0000 (GMT) Received: from pi.codefab.com (pi.codefab.com [199.103.21.227]) by mx1.FreeBSD.org (Postfix) with ESMTP id 11B1243D45 for ; Fri, 7 Jan 2005 12:32:00 +0000 (GMT) (envelope-from cswiger@mac.com) Received: from [192.168.1.3] (pool-68-160-208-232.ny325.east.verizon.net [68.160.208.232]) by pi.codefab.com (8.12.11/8.12.11) with ESMTP id j07CVqWZ088481 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 7 Jan 2005 07:31:54 -0500 (EST) Message-ID: <41DE810A.1090105@mac.com> Date: Fri, 07 Jan 2005 07:31:06 -0500 From: Chuck Swiger Organization: The Courts of Chaos User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.3) Gecko/20040910 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Brooks Davis References: <20050106215923.GA31004@odin.ac.hmc.edu> In-Reply-To: <20050106215923.GA31004@odin.ac.hmc.edu> X-Enigmail-Version: 0.89.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=1.8 required=5.5 tests=RCVD_IN_NJABL_DUL, RCVD_IN_SORBS_DUL autolearn=disabled version=3.0.1 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.0.1 (2004-10-22) on pi.codefab.com cc: freebsd-ipfw@freebsd.org Subject: Re: [PATCH] deprecating abrevations in ipfw X-BeenThere: freebsd-ipfw@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: IPFW Technical Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jan 2005 12:32:00 -0000 Brooks Davis wrote: > The ipfw program's code is littered with unmaintainable uses of strncmp > to implement abbreviations. The following patch replaces those with > two new functions which simplify the code and produce warnings that the > syntax is deprecated. In a future release, those can be converted to > hard errors and then finally the code can revert to using strcmp. The > intention is to explicitly support a small number of abbreviations that > actually make sense rather then allowing arbitrary shortening of some > words. Excellent, thanks for working on this. For what it's worth, about 95% of this diff applied OK with an offset under 5-STABLE; but two pieces around: *************** *** 1715,1736 **** if (ac == 0) { warnx("missing keyword to enable/disable\n"); - } else if (strncmp(*av, "firewall", strlen(*av)) == 0) { [ ... ] ...and: *************** *** 2991,2997 **** have_log = (ipfw_insn *)c; cmd->len = F_INSN_SIZE(ipfw_insn_log); cmd->opcode = O_LOG; - if (ac && !strncmp(*av, "logamount", strlen(*av))) { ac--; av++; ...needed manual adjustment. The resulting ipfw binary seems to work OK with a simple client-oriented ruleset, but I haven't pushed it very hard yet. Also, at the end of your message there was a unrelated diff...? > ==== //depot/user/brooks/ports/slimserver/Makefile#20 - /home/brooks/working/freebsd/p4/ports/slimserver/Makefile ==== > @@ -26,7 +26,7 @@ > RUN_DEPENDS+= ${SLIM_CPAN_DEPS:S|^|${SITE_PERL}/|:S|:|:${PORTSDIR}/|} [ ... ] -- -Chuck