Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 368324
b: refs/heads/master
c: 3e5289d
h: refs/heads/master
v: v3
  • Loading branch information
Daniel Borkmann authored and David S. Miller committed Mar 20, 2013
1 parent ed8f5b4 commit 7116a72
Show file tree
Hide file tree
Showing 4 changed files with 9 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: f77668dc25b27270fe589031b22c432c3462b1d8
refs/heads/master: 3e5289d5e3f98b7b5b8cac32e9e5a7004c067436
1 change: 1 addition & 0 deletions trunk/include/linux/filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ enum {
BPF_S_ANC_SECCOMP_LD_W,
BPF_S_ANC_VLAN_TAG,
BPF_S_ANC_VLAN_TAG_PRESENT,
BPF_S_ANC_PAY_OFFSET,
};

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

Expand Down
5 changes: 5 additions & 0 deletions trunk/net/core/filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,9 @@ unsigned int sk_run_filter(const struct sk_buff *skb,
case BPF_S_ANC_VLAN_TAG_PRESENT:
A = !!vlan_tx_tag_present(skb);
continue;
case BPF_S_ANC_PAY_OFFSET:
A = __skb_get_poff(skb);
continue;
case BPF_S_ANC_NLATTR: {
struct nlattr *nla;

Expand Down Expand Up @@ -612,6 +615,7 @@ int sk_chk_filter(struct sock_filter *filter, unsigned int flen)
ANCILLARY(ALU_XOR_X);
ANCILLARY(VLAN_TAG);
ANCILLARY(VLAN_TAG_PRESENT);
ANCILLARY(PAY_OFFSET);
}

/* ancillary operation unknown or unsupported */
Expand Down Expand Up @@ -814,6 +818,7 @@ static void sk_decode_filter(struct sock_filter *filt, struct sock_filter *to)
[BPF_S_ANC_SECCOMP_LD_W] = BPF_LD|BPF_B|BPF_ABS,
[BPF_S_ANC_VLAN_TAG] = BPF_LD|BPF_B|BPF_ABS,
[BPF_S_ANC_VLAN_TAG_PRESENT] = BPF_LD|BPF_B|BPF_ABS,
[BPF_S_ANC_PAY_OFFSET] = BPF_LD|BPF_B|BPF_ABS,
[BPF_S_LD_W_LEN] = BPF_LD|BPF_W|BPF_LEN,
[BPF_S_LD_W_IND] = BPF_LD|BPF_W|BPF_IND,
[BPF_S_LD_H_IND] = BPF_LD|BPF_H|BPF_IND,
Expand Down

0 comments on commit 7116a72

Please sign in to comment.