Re: Question on VLAN
- From: Jon Simola <jon@xxxxxxxxxxx>
- Date: Mon, 23 Jan 2006 16:59:46 -0800
On 1/23/06, Gregory Nou <gregorynou@xxxxxxxxxx> wrote:
> Hi,
>
> What is the difference between
> if (m->m_flags & M_VLANTAG)
> and
> if (ether_type == ETHERTYPE_VLAN) ?
>
> I suppose that m->m_flags are set using ether_type at one point. Still,
> I was not able to find a location in the source where it would happen.
You're right, the M_VLANTAG is a tag on an mbuf to show it's an 802.1q
packet, and looks like it gets turned on in vlan_start() in if_vlan.c
ETHERTYPE_VLAN is 0x8100 and is a constant in 802.1q packets as they
appear on the wire (just after the src/dst MAC addresses, offset 0x18
IIRC).
> The fact is, I do not understand the difference between these two
> things, nor do I understand why we need the code in if_ethersubr.c[691-717]
If the interface does de/tagging at the hardware level the kernel gets
the vlan bits already seperated, otherwise it has to figure it out by
looking in the header for the presence of the ETHERTYPE_VLAN tag.
Hope that helps you out.
--
Jon Simola
Systems Administrator
ABC Communications
_______________________________________________
freebsd-net@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscribe@xxxxxxxxxxx"
- References:
- Question on VLAN
- From: Gregory Nou
- Question on VLAN
- Prev by Date: Question on VLAN
- Next by Date: Marvell/SysKonnect YukonII source code available
- Previous by thread: Question on VLAN
- Next by thread: Re: Question on VLAN
- Index(es):
Relevant Pages
|