From 9ec138101f8a79007bc571174976a7814ed616f8 Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Tue, 5 Feb 2008 16:21:04 -0800 Subject: [NET_SCHED]: cls_flow: support classification based on VLAN tag Signed-off-by: Patrick McHardy Signed-off-by: David S. Miller --- net/sched/cls_flow.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'net/sched') diff --git a/net/sched/cls_flow.c b/net/sched/cls_flow.c index eeb223cf14cf..971b867e0484 100644 --- a/net/sched/cls_flow.c +++ b/net/sched/cls_flow.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -270,6 +271,15 @@ static u32 flow_get_skgid(const struct sk_buff *skb) return 0; } +static u32 flow_get_vlan_tag(const struct sk_buff *skb) +{ + u16 uninitialized_var(tag); + + if (vlan_get_tag(skb, &tag) < 0) + return 0; + return tag & VLAN_VID_MASK; +} + static u32 flow_key_get(const struct sk_buff *skb, int key) { switch (key) { @@ -305,6 +315,8 @@ static u32 flow_key_get(const struct sk_buff *skb, int key) return flow_get_skuid(skb); case FLOW_KEY_SKGID: return flow_get_skgid(skb); + case FLOW_KEY_VLAN_TAG: + return flow_get_vlan_tag(skb); default: WARN_ON(1); return 0; -- cgit v1.2.3