From owner-freebsd-net@FreeBSD.ORG Sat Nov 6 16:13:57 2004 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 63EAB16A4CE for ; Sat, 6 Nov 2004 16:13:57 +0000 (GMT) Received: from mail.netroad.ru (mail.netroad.ru [213.24.172.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id BD9BE43D49 for ; Sat, 6 Nov 2004 16:13:56 +0000 (GMT) (envelope-from devel@proxy.netroad.ru) Received: from mail.netroad.ru (localhost [127.0.0.1]) by mail.netroad.ru (Postfix) with ESMTP id 7A3701487C8 for ; Sat, 6 Nov 2004 19:12:21 +0300 (MSK) Received: from proxy.netroad.ru (proxy.netroad.ru [213.24.172.2]) by mail.netroad.ru (Postfix) with ESMTP id 5AD131486BF for ; Sat, 6 Nov 2004 19:12:21 +0300 (MSK) Received: by proxy.netroad.ru (Postfix, from userid 999) id AB67C256245; Sat, 6 Nov 2004 19:13:51 +0300 (MSK) Date: Sat, 6 Nov 2004 19:13:51 +0300 From: "Lenar D. Tukhvatullin" To: freebsd-net@freebsd.org Message-ID: <20041106161351.GA90407@proxy.netroad.ru> Mail-Followup-To: freebsd-net@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.5.1i X-AntiVirus: ClamAV at mail.netroad.ru Subject: bridging & vlan X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Nov 2004 16:13:57 -0000 System: FreeBSD 5.3-STABLE, cvsup'ed today. I have bge0 interface and vlan0 configured on it: ----- bge0: flags=8943 mtu 1500 options=1a vlan0: flags=28943 mtu 1500 vlan: 100 parent interface: bge0 ---- I configure bridge between vlan0 and another physical interface (bge1), but bridge does not work properly. I can see incoming packets (packets from LAN with corresponding vlan tag) with tcpdump on bge0, but can't see these packets on vlan0. I think, it's a bug in sys/net/if_ethersubr.c in function ether_demux: ---- if (!(BDG_ACTIVE(ifp)) && !(ether_type == ETHERTYPE_VLAN && ifp->if_nvlans > 0)) { ---- This checks only 802.1Q incapsulated ethernet frames, but incoming packets on bge0 contains normal, decapsulated packets (VLAN_HWTAGGING) It is necessary to make additional check on incoming packet: ---- if (!(BDG_ACTIVE(ifp)) && !((ether_type == ETHERTYPE_VLAN || m_tag_locate(m, MTAG_VLAN, MTAG_VLAN_TAG, NULL) != NULL) && ifp->if_nvlans > 0)) { ---- I also submitted this problem as PR: kern/72933 -- Lenar D. Tukhvatullin