From owner-freebsd-pf@FreeBSD.ORG Fri Apr 28 10:35:35 2006 Return-Path: X-Original-To: freebsd-pf@freebsd.org Delivered-To: freebsd-pf@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5805216A403; Fri, 28 Apr 2006 10:35:35 +0000 (UTC) (envelope-from dhartmei@insomnia.benzedrine.cx) Received: from insomnia.benzedrine.cx (insomnia.benzedrine.cx [62.65.145.30]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7CDDE43D48; Fri, 28 Apr 2006 10:35:32 +0000 (GMT) (envelope-from dhartmei@insomnia.benzedrine.cx) Received: from insomnia.benzedrine.cx (dhartmei@localhost [127.0.0.1]) by insomnia.benzedrine.cx (8.13.4/8.13.4) with ESMTP id k3SAZUR2011674 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES256-SHA bits=256 verify=NO); Fri, 28 Apr 2006 12:35:31 +0200 (MEST) Received: (from dhartmei@localhost) by insomnia.benzedrine.cx (8.13.4/8.12.10/Submit) id k3SAZU8Z017288; Fri, 28 Apr 2006 12:35:30 +0200 (MEST) Date: Fri, 28 Apr 2006 12:35:30 +0200 From: Daniel Hartmeier To: Boris Polevoy Message-ID: <20060428103529.GL19449@insomnia.benzedrine.cx> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.10i Cc: mlaier@freebsd.org, pf@benzedrine.cx, freebsd-pf@freebsd.org Subject: Re: PF with subanchors possible bug X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Technical discussion and general questions about packet filter \(pf\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Apr 2006 10:35:35 -0000 On Fri, Apr 28, 2006 at 12:42:13PM +0400, Boris Polevoy wrote: > Is it bug or not? Yes, it looks like a bug. Or, more than one, actually. I assume what you expect the sequence to do is the same as # echo 'anchor "external"' | pfctl -f - # echo 'anchor "internal"' | pfctl -a external -f - # echo 'pass all' | pfctl -a external/internal -f - (leaving out the table, which isn't really relevant, I think) i.e. you expect "internal" to be nested within "external", like # pfctl -vsA external external/internal # pfctl -sr anchor "external" all # pfctl -a external -sr anchor "internal" all # pfctl -a external/internal -sr pass all Your patch fixes that. But there is another one, when doing "pfctl -a external -f", it doesn't prefix the (relative!) paths within the input with the anchor specified through -a. Therefore, when I do the same (it should be the same, IMO) with files, like # cat x anchor "external" load anchor "external" from "y" # cat y anchor "internal" load anchor "internal" from "z" # cat z pass z # pfctl -f x # pfctl -vsA external external/internal internal # pfctl -a external/internal -sr [ empty ] # pfctl -a internal -sr pass all the rule loaded from z is not placed into the right anchor (external/internal), but a second anchor (internal) is created for it. I'll have to find the right place to fix THAT, too. Daniel