Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83288
b: refs/heads/master
c: 3113e88
h: refs/heads/master
v: v3
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Feb 5, 2008
1 parent 19fd6ea commit 75bb834
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dded91611a728d65721cdab3dd41d801a356fa15
refs/heads/master: 3113e88c3cb3c0a22920b621f8e4d1f2ccc07f1e
3 changes: 2 additions & 1 deletion trunk/include/linux/pkt_cls.h
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,8 @@ enum
#define TCF_EM_U32 3
#define TCF_EM_META 4
#define TCF_EM_TEXT 5
#define TCF_EM_MAX 5
#define TCF_EM_VLAN 6
#define TCF_EM_MAX 6

enum
{
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/tc_ematch/tc_em_meta.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ enum
TCF_META_ID_SK_SNDTIMEO,
TCF_META_ID_SK_SENDMSG_OFF,
TCF_META_ID_SK_WRITE_PENDING,
TCF_META_ID_VLAN_TAG,
__TCF_META_ID_MAX
};
#define TCF_META_ID_MAX (__TCF_META_ID_MAX - 1)
Expand Down
17 changes: 17 additions & 0 deletions trunk/net/sched/em_meta.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
#include <linux/string.h>
#include <linux/skbuff.h>
#include <linux/random.h>
#include <linux/if_vlan.h>
#include <linux/tc_ematch/tc_em_meta.h>
#include <net/dst.h>
#include <net/route.h>
Expand Down Expand Up @@ -169,6 +170,21 @@ META_COLLECTOR(var_dev)
*err = var_dev(skb->dev, dst);
}

/**************************************************************************
* vlan tag
**************************************************************************/

META_COLLECTOR(int_vlan_tag)
{
unsigned short tag;
if (vlan_get_tag(skb, &tag) < 0)
*err = -1;
else
dst->value = tag;
}



/**************************************************************************
* skb attributes
**************************************************************************/
Expand Down Expand Up @@ -520,6 +536,7 @@ static struct meta_ops __meta_ops[TCF_META_TYPE_MAX+1][TCF_META_ID_MAX+1] = {
[META_ID(SK_SNDTIMEO)] = META_FUNC(int_sk_sndtimeo),
[META_ID(SK_SENDMSG_OFF)] = META_FUNC(int_sk_sendmsg_off),
[META_ID(SK_WRITE_PENDING)] = META_FUNC(int_sk_write_pend),
[META_ID(VLAN_TAG)] = META_FUNC(int_vlan_tag),
}
};

Expand Down

0 comments on commit 75bb834

Please sign in to comment.