From owner-freebsd-net@FreeBSD.ORG Tue Jan 24 19:24:55 2006 Return-Path: X-Original-To: freebsd-net@FreeBSD.org 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 BC25A16A420 for ; Tue, 24 Jan 2006 19:24:55 +0000 (GMT) (envelope-from glebius@FreeBSD.org) Received: from cell.sick.ru (cell.sick.ru [217.72.144.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id CFCDC43D45 for ; Tue, 24 Jan 2006 19:24:54 +0000 (GMT) (envelope-from glebius@FreeBSD.org) Received: from cell.sick.ru (glebius@localhost [127.0.0.1]) by cell.sick.ru (8.13.3/8.13.3) with ESMTP id k0OJOiNS091354 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 24 Jan 2006 22:24:45 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.sick.ru (8.13.3/8.13.1/Submit) id k0OJOiVT091353; Tue, 24 Jan 2006 22:24:44 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.sick.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 24 Jan 2006 22:24:43 +0300 From: Gleb Smirnoff To: Gregory Nou Message-ID: <20060124192443.GR83922@FreeBSD.org> Mail-Followup-To: Gleb Smirnoff , Gregory Nou , freebsd-net@freebsd.org References: <43D557B0.2080306@altern.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <43D557B0.2080306@altern.org> User-Agent: Mutt/1.5.6i Cc: freebsd-net@FreeBSD.org Subject: Re: Question on VLAN 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: Tue, 24 Jan 2006 19:24:55 -0000 On Mon, Jan 23, 2006 at 11:24:48PM +0100, Gregory Nou wrote: G> What is the difference between G> if (m->m_flags & M_VLANTAG) G> and G> if (ether_type == ETHERTYPE_VLAN) ? G> G> I suppose that m->m_flags are set using ether_type at one point. Still, G> I was not able to find a location in the source where it would happen. G> G> The fact is, I do not understand the difference between these two G> things, nor do I understand why we need the code in if_ethersubr.c[691-717] Some drivers are capable to recognise VLAN frames. In this case mbuf has M_VLANTAG set on it, vlan tag is stored in mbuf tag, and mbuf contains untagged frame. For those drivers that aren't capable to handle VLAN frames, we need to look into frame and see the tag. -- Totus tuus, Glebius. GLEBIUS-RIPN GLEB-RIPE