diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2009-10-26 21:40:35 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-27 04:02:33 -0400 |
commit | 05423b241311c9380b7280179295bac7794281b6 (patch) | |
tree | 8a84aca48cbc30b142bdf143dbf11fdbab9cad67 /net/core/dev.c | |
parent | 9dbb58d867e90d2528752339751216c955523e62 (diff) |
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>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r-- | net/core/dev.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index e7bada1d5ed9..950c13fa60d2 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -2300,7 +2300,7 @@ int netif_receive_skb(struct sk_buff *skb) | |||
2300 | if (!skb->tstamp.tv64) | 2300 | if (!skb->tstamp.tv64) |
2301 | net_timestamp(skb); | 2301 | net_timestamp(skb); |
2302 | 2302 | ||
2303 | if (skb->vlan_tci && vlan_hwaccel_do_receive(skb)) | 2303 | if (vlan_tx_tag_present(skb) && vlan_hwaccel_do_receive(skb)) |
2304 | return NET_RX_SUCCESS; | 2304 | return NET_RX_SUCCESS; |
2305 | 2305 | ||
2306 | /* if we've gotten here through NAPI, check netpoll */ | 2306 | /* if we've gotten here through NAPI, check netpoll */ |