Date: Fri, 07 Jan 2005 07:31:06 -0500 From: Chuck Swiger <cswiger@mac.com> To: Brooks Davis <brooks@one-eyed-alien.net> Cc: freebsd-ipfw@freebsd.org Subject: Re: [PATCH] deprecating abrevations in ipfw Message-ID: <41DE810A.1090105@mac.com> In-Reply-To: <20050106215923.GA31004@odin.ac.hmc.edu> References: <20050106215923.GA31004@odin.ac.hmc.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?41DE810A.1090105>