Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83635
b: refs/heads/master
c: 9ec1381
h: refs/heads/master
i:
  83633: c0b822b
  83631: 4b948ec
v: v3
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Feb 6, 2008
1 parent 7694467 commit e6e7377
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 181499356e5a9f0bcbd69adc3c6df450f6e2586d
refs/heads/master: 9ec138101f8a79007bc571174976a7814ed616f8
1 change: 1 addition & 0 deletions trunk/include/linux/pkt_cls.h
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ enum
FLOW_KEY_RTCLASSID,
FLOW_KEY_SKUID,
FLOW_KEY_SKGID,
FLOW_KEY_VLAN_TAG,
__FLOW_KEY_MAX,
};

Expand Down
12 changes: 12 additions & 0 deletions trunk/net/sched/cls_flow.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <linux/in.h>
#include <linux/ip.h>
#include <linux/ipv6.h>
#include <linux/if_vlan.h>

#include <net/pkt_cls.h>
#include <net/ip.h>
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit e6e7377

Please sign in to comment.