From owner-freebsd-net@FreeBSD.ORG Thu Mar 8 23:09:58 2007 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0BCFB16A400; Thu, 8 Mar 2007 23:09:58 +0000 (UTC) (envelope-from rik@inse.ru) Received: from mail.inse.ru (inse.ru [144.206.128.1]) by mx1.freebsd.org (Postfix) with ESMTP id B4E5013C471; Thu, 8 Mar 2007 23:09:57 +0000 (UTC) (envelope-from rik@inse.ru) Received: from [127.0.0.1] (www.inse.ru [144.206.128.1]) by mail.inse.ru (Postfix) with ESMTP id EA4B833C4C; Fri, 9 Mar 2007 02:09:55 +0300 (MSK) Message-ID: <45F09891.2020505@inse.ru> Date: Fri, 09 Mar 2007 02:13:21 +0300 From: Roman Kurakin User-Agent: Thunderbird 1.5.0.9 (X11/20070212) MIME-Version: 1.0 To: Andrew Thompson References: <45E9F1E8.2000802@inse.ru> <20070304062203.GL80319@codelabs.ru> <45E9F1E8.2000802@inse.ru> <20070304160613.GN80319@codelabs.ru> <45EDA348.3030309@inse.ru> <20070307210254.GD54828@heff.fud.org.nz> In-Reply-To: <20070307210254.GD54828@heff.fud.org.nz> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: rik@FreeBSD.org, freebsd-net@freebsd.org, glebius@FreeBSD.org, andre@FreeBSD.org, bms@FreeBSD.org Subject: Re: kern/109815: wrong interface identifier at pfil_hooks for vlans + if_bridge X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Mar 2007 23:09:58 -0000 Andrew Thompson wrote: > On Tue, Mar 06, 2007 at 08:22:16PM +0300, Roman Kurakin wrote: > >> Ok, since no one want to provide an explanation I'll to do it myself. >> > ... > >> I suggest to fix this problem in the other way, by checking if the >> physical interface >> is the dst interface by MAC. Eq if we got packet from Ci, it will be >> market as received >> from Ci, not from Cj. Yes it will add double checking for this interface >> it is not the >> dst with some probability, but will optimize the case the dst is the >> current one cause >> we will not check the list. This will keep the old behaviour eq case 1 >> and will do the >> same trick for cases like VLANs. Here my variant of the patch: >> > > I think this is probably the best way to do it. I have only been loosely > following this thread due to other stuff going on. > > >> + /* Give a chance for ifp at first priority. This will help in case >> we >> + * the packet comes through the interface with VLAN's and the same >> + * MACs on several interfaces in a bridge. Also will save some >> circles >> + * in case dst interface is the physical input interface (eq ifp). >> + */ >> + if (ifp->if_type == IFT_GIF >> > ^^^^^^^^^^^^^^^^^^^^^^^ > is this check right? > > It was taken from original code. In the rest part of course there is no bif2, but ifp. I'll plane to make a macro as suggested by Eygene. This code shouldn't be in a separate function for sure. So code will look like #define somemacro .... somemacro(ifp) LIST_FOREACH() somemacro(bif2->bif_ifp) rik