From owner-freebsd-net@FreeBSD.ORG Mon Mar 5 14:56:55 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 B131A16A403; Mon, 5 Mar 2007 14:56:55 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) Received: from pobox.codelabs.ru (pobox.codelabs.ru [144.206.177.45]) by mx1.freebsd.org (Postfix) with ESMTP id 62C2C13C467; Mon, 5 Mar 2007 14:56:55 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) Received: from codelabs.ru (pobox.codelabs.ru [144.206.177.45]) by pobox.codelabs.ru with esmtpsa (TLSv1:AES256-SHA:256) id 1HOEcP-000Oq8-8P; Mon, 05 Mar 2007 17:56:53 +0300 Date: Mon, 5 Mar 2007 17:56:47 +0300 From: Eygene Ryabinkin To: "Bruce M. Simpson" Message-ID: <20070305145647.GT80319@codelabs.ru> References: <45E9F1E8.2000802@inse.ru> <20070304062203.GL80319@codelabs.ru> <45E9F1E8.2000802@inse.ru> <20070304160613.GN80319@codelabs.ru> <45EB4915.1090703@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <45EB4915.1090703@FreeBSD.org> Sender: rea-fbsd@codelabs.ru X-Spam-Status: No, score=-3.4 required=4.0 tests=ALL_TRUSTED,AWL,BAYES_00 Cc: rik@FreeBSD.org, freebsd-net@freebsd.org, glebius@FreeBSD.org, andre@FreeBSD.org, thompsa@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: Mon, 05 Mar 2007 14:56:55 -0000 Bruce, > >And a question: can anyone say if my patch will break some known > >good behaviour and if the current behaviour of if_bridge is based > >on some logic I am currently failing to understand. > > > I would greatly appreciate it if you could look at the combined M_PROMISC and > 802.1p patch, which rewrites ether_input() significantly. It sounds like the > issues you are having with vlans and bridges may potentially be fixed by this > patch, or that the fix may be incorporated more easily with this patch. Studied your patch as a patch, but not tried it on a live system. I feel that your patch will not help in my situation, just because my problem lies in the if_bridge.c::bridge_input() that is invoked from if_ethersubr.c as BRIDGE_INPUT() macro. I see that your patch sets some flags, tries to handle 802.1q packets, gives netgraph a chance on the packet, but still passes the packet to BRIDGE_INPUT just clearing the M_PROMISC bit. And all Bad Things in my case are done in the bridge_input. As my packets are going to the ether_input with VLAN tags stripped by hardware and the if_bridge does not care about M_PROMISC I see no theoretical difference if your patch will be applied. Sure, I can test it, but then I need to know what problems are cured by your patch, or I just should watch if it will not break something. > In NetBSD, after if_bridge is given a chance to claim an input frame, the ifp > may be changed if the bridge needs to forward locally. In my case if_bridge drops off the packet because firewall fails to recognize the packet as good: the interface that is passed to a pfil_hooks is bad (I mean not the one expected). > M_PROMISC is used to > indicate that a frame was received promiscuously, in case ether_input() > re-enters itself with the same mbuf chain. Certain consumers of ether_input() > need to punch holes in the logic used to detect if a frame was for us or not > because they do funky things with Ethernet destination addresses, e.g. carp. By the way: just grepped /sys/net and /sys/netinet on the 6-STABLE for the M_PROMISC -- no hits. Are you talking about 6-STABLE or 7-CURRENT? I have my issue on the 6-STABLE, but 7-CURRENT should also have it. Will try to see if your patch makes any difference for the 7-CURRENT, but I have no system at hand to test it, sorry. -- Eygene