Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 340547
b: refs/heads/master
c: f333503
h: refs/heads/master
i:
  340545: febc290
  340543: bac38be
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Oct 31, 2012
1 parent ecbba11 commit f5d4afd
Show file tree
Hide file tree
Showing 4 changed files with 15 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: 0f6ae8f14e7a6a068e9a98a0d3484ffa6bf2c6bb
refs/heads/master: f3335031b9452baebfe49b8b5e55d3fe0c4677d1
2 changes: 2 additions & 0 deletions trunk/include/linux/filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ enum {
BPF_S_ANC_CPU,
BPF_S_ANC_ALU_XOR_X,
BPF_S_ANC_SECCOMP_LD_W,
BPF_S_ANC_VLAN_TAG,
BPF_S_ANC_VLAN_TAG_PRESENT,
};

#endif /* __LINUX_FILTER_H__ */
4 changes: 3 additions & 1 deletion trunk/include/uapi/linux/filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ struct sock_fprog { /* Required for SO_ATTACH_FILTER. */
#define SKF_AD_RXHASH 32
#define SKF_AD_CPU 36
#define SKF_AD_ALU_XOR_X 40
#define SKF_AD_MAX 44
#define SKF_AD_VLAN_TAG 44
#define SKF_AD_VLAN_TAG_PRESENT 48
#define SKF_AD_MAX 52
#define SKF_NET_OFF (-0x100000)
#define SKF_LL_OFF (-0x200000)

Expand Down
9 changes: 9 additions & 0 deletions trunk/net/core/filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include <linux/reciprocal_div.h>
#include <linux/ratelimit.h>
#include <linux/seccomp.h>
#include <linux/if_vlan.h>

/* No hurry in this branch
*
Expand Down Expand Up @@ -341,6 +342,12 @@ unsigned int sk_run_filter(const struct sk_buff *skb,
case BPF_S_ANC_CPU:
A = raw_smp_processor_id();
continue;
case BPF_S_ANC_VLAN_TAG:
A = vlan_tx_tag_get(skb);
continue;
case BPF_S_ANC_VLAN_TAG_PRESENT:
A = !!vlan_tx_tag_present(skb);
continue;
case BPF_S_ANC_NLATTR: {
struct nlattr *nla;

Expand Down Expand Up @@ -600,6 +607,8 @@ int sk_chk_filter(struct sock_filter *filter, unsigned int flen)
ANCILLARY(RXHASH);
ANCILLARY(CPU);
ANCILLARY(ALU_XOR_X);
ANCILLARY(VLAN_TAG);
ANCILLARY(VLAN_TAG_PRESENT);
}
}
ftest->code = code;
Expand Down

0 comments on commit f5d4afd

Please sign in to comment.