From owner-freebsd-ipfw@FreeBSD.ORG Wed Jan 14 13:54:20 2004 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 5890916A4CE for ; Wed, 14 Jan 2004 13:54:20 -0800 (PST) Received: from shellma.zin.lublin.pl (shellma.zin.lublin.pl [212.182.126.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9AC6343D53 for ; Wed, 14 Jan 2004 13:54:18 -0800 (PST) (envelope-from pawmal-posting@freebsd.lublin.pl) Received: by shellma.zin.lublin.pl (Postfix, from userid 1018) id 781675F103; Wed, 14 Jan 2004 23:05:39 +0100 (CET) Date: Wed, 14 Jan 2004 23:05:38 +0100 From: Pawel Malachowski To: Luigi Rizzo Message-ID: <20040114220538.GA72981@shellma.zin.lublin.pl> References: <20040114082004.A43466@xorpc.icir.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20040114082004.A43466@xorpc.icir.org> User-Agent: Mutt/1.4.1i cc: ipfw@freebsd.org Subject: Re: semantics of 'not-applicable' options 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: Wed, 14 Jan 2004 21:54:20 -0000 On Wed, Jan 14, 2004 at 08:20:04AM -0800, Luigi Rizzo wrote: > As the subject says... what is people's opinion on the > best semantics for 'not-applicable' options in ipfw rules ? > > As an example, if i say (using ipfw2 syntax, for simplicity) > > 100 count src-port 100 > 200 count not src-port 100 > > and i receive a fragment, or an ICMP packet (which does not have port > information available), should it match rule 100, rule 200, none > or both ? The current implementation in ipfw2 is to use binary > logic, so the outcome of a 'not-applicable' option is FALSE, > and its negation is TRUE (so in the above case rule 200 will succeed). Ports are meaningful for TCP or UDP packets. If one uses src-port in rule, he assumes such a rule is for TCP or UDP packets. That's why I think rule 200 shouldn't match ICMP datagram. I also think ambiguous rules should be forbidden. This will force users to work with well planned rules. ;) -- Paweł Małachowski