diff options
author | Eric Dumazet <edumazet@google.com> | 2012-10-27 02:26:17 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-10-31 14:00:15 -0400 |
commit | f3335031b9452baebfe49b8b5e55d3fe0c4677d1 (patch) | |
tree | c73f4d2827d3b58b4866488a35b4b462e52713ba /include/linux/filter.h | |
parent | 0f6ae8f14e7a6a068e9a98a0d3484ffa6bf2c6bb (diff) | |
download | linux-stable-f3335031b9452baebfe49b8b5e55d3fe0c4677d1.tar.gz linux-stable-f3335031b9452baebfe49b8b5e55d3fe0c4677d1.tar.bz2 linux-stable-f3335031b9452baebfe49b8b5e55d3fe0c4677d1.zip |
net: filter: add vlan tag access
BPF filters lack ability to access skb->vlan_tci
This patch adds two new ancillary accessors :
SKF_AD_VLAN_TAG (44) mapped to vlan_tx_tag_get(skb)
SKF_AD_VLAN_TAG_PRESENT (48) mapped to vlan_tx_tag_present(skb)
This allows libpcap/tcpdump to use a kernel filter instead of
having to fallback to accept all packets, then filter them in
user space.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Suggested-by: Ani Sinha <ani@aristanetworks.com>
Suggested-by: Daniel Borkmann <danborkmann@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/filter.h')
-rw-r--r-- | include/linux/filter.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/filter.h b/include/linux/filter.h index 24d251f3bab0..c9f0005c35e2 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h @@ -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__ */ |