android_kernel_motorola_sm6225/net/8021q
Eric Dumazet 05423b2413 vlan: allow null VLAN ID to be used
We currently use a 16 bit field (vlan_tci) to store VLAN ID/PRIO on a skb.

Null value is used as a special value, meaning vlan tagging not enabled.
This forbids use of null vlan ID.

As pointed by David, some drivers use the 3 high order bits (PRIO)

As VLAN ID is 12 bits, we can use the remaining bit (CFI) as a flag, and
allow null VLAN ID.

In case future code really wants to use VLAN_CFI_MASK, we'll have to use
a bit outside of vlan_tci.

#define VLAN_PRIO_MASK         0xe000 /* Priority Code Point */
#define VLAN_PRIO_SHIFT        13
#define VLAN_CFI_MASK          0x1000 /* Canonical Format Indicator */
#define VLAN_TAG_PRESENT       VLAN_CFI_MASK
#define VLAN_VID_MASK          0x0fff /* VLAN Identifier */

Reported-by: Gertjan Hofman <gertjan_hofman@yahoo.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-27 01:02:33 -07:00
..
Kconfig vlan: Add GVRP support 2008-07-05 21:26:57 -07:00
Makefile vlan: uninline __vlan_hwaccel_rx 2008-07-08 03:23:36 -07:00
vlan.c vlan: multiqueue vlan device 2009-09-02 18:03:00 -07:00
vlan.h vlan: allow null VLAN ID to be used 2009-10-27 01:02:33 -07:00
vlan_core.c Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2009-04-16 17:35:26 -07:00
vlan_dev.c vlan: allow null VLAN ID to be used 2009-10-27 01:02:33 -07:00
vlan_gvrp.c vlan: TCI related type and naming cleanups 2008-07-08 03:24:44 -07:00
vlan_netlink.c net: fix vlan_get_size to include vlan_flags size 2009-09-26 20:16:07 -07:00
vlanproc.c net: mark read-only arrays as const 2009-08-05 10:42:58 -07:00
vlanproc.h [VLAN]: Add a net argument to proc init and cleanup calls. 2008-04-16 00:51:12 -07:00