Question on VLAN

Gleb Smirnoff glebius at FreeBSD.org
Tue Jan 24 11:24:55 PST 2006


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


More information about the freebsd-net mailing list