From owner-freebsd-ipfw@FreeBSD.ORG Thu Mar 23 14:57:40 2006 Return-Path: X-Original-To: FreeBSD-ipfw@freebsd.org 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 497E416A454 for ; Thu, 23 Mar 2006 14:57:40 +0000 (UTC) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (xorpc.icir.org [192.150.187.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id CD49C43D78 for ; Thu, 23 Mar 2006 14:57:31 +0000 (GMT) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (localhost [127.0.0.1]) by xorpc.icir.org (8.12.11/8.12.11) with ESMTP id k2NEvTiP067487; Thu, 23 Mar 2006 06:57:29 -0800 (PST) (envelope-from rizzo@xorpc.icir.org) Received: (from rizzo@localhost) by xorpc.icir.org (8.12.11/8.12.3/Submit) id k2NEvTUI067486; Thu, 23 Mar 2006 06:57:29 -0800 (PST) (envelope-from rizzo) Date: Thu, 23 Mar 2006 06:57:29 -0800 From: Luigi Rizzo To: Dmitry Pryanishnikov Message-ID: <20060323065729.C67264@xorpc.icir.org> References: <20060323133729.D63213@atlantis.atlantis.dp.ua> <20060323060006.A66681@xorpc.icir.org> <20060323162418.S45142@atlantis.atlantis.dp.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20060323162418.S45142@atlantis.atlantis.dp.ua>; from dmitry@atlantis.dp.ua on Thu, Mar 23, 2006 at 04:47:17PM +0200 Cc: FreeBSD-ipfw@freebsd.org Subject: Re: IPFW1->2 regression: "in/out/via any" ignored X-BeenThere: freebsd-ipfw@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: IPFW Technical Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Mar 2006 14:57:40 -0000 On Thu, Mar 23, 2006 at 04:47:17PM +0200, Dmitry Pryanishnikov wrote: ... > > For locally generated packets i admit 'recv any' may be of some use, > > and this is unsupported. There are probably workaround such as 'src-ip me' > > Oops! How can one know that feature which is documented from the beginning, > which worked in ipfw1 - became 'unsupported' in ipfw2? It's clearly a > regression to me, given that I can't use ipfw1 with modern RELENGs. it's a bug, never seen one before ? :) > > which may be of some help here although this particular instruction > > can be expensive as it has to scan the list of local addresses. > > I don't understand that part. Given that 'out recv ifx' still works, we have > incoming interface name for every transit outgoing packet. I'm sure there is > some indication in this field that clearly says: "packet _is_ > locally-generated". Isn't it? yes, i am just saying that there is no code in the kernel and in the userland compiler that interprets that info correctly. I repeat - it's a bug. I'ts probably trivial to fix, but at the moment i don't have the time to work on it. If you want, the places to touch are: sbin/ipfw/ipfw2.c the two places which parse TOK_RECV and O_RECV, should be enabled to deal with 'any' as an interface name and encode it somewhere in the instruction (see function fill_iface(), at the moment 'any' is interpreted as NULL, it could become some magic value e.g. 0x1 or the like) sys/netinet/ip_fw2.c in function iface_match(), you should check whether this magic value is present in the instruction and then return 0 or 1 depending on whether or not the 'ifp' argument is non-null. and this should be all you need to do (testing, of course :) cheers luigi > Sincerely, Dmitry > -- > Atlantis ISP, System Administrator > e-mail: dmitry@atlantis.dp.ua > nic-hdl: LYNX-RIPE