diff options
author | Eric Dumazet <edumazet@google.com> | 2012-10-26 22:26:17 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-10-31 14:00:15 -0400 |
commit | f3335031b9452baebfe49b8b5e55d3fe0c4677d1 (patch) | |
tree | c73f4d2827d3b58b4866488a35b4b462e52713ba /include/uapi | |
parent | 0f6ae8f14e7a6a068e9a98a0d3484ffa6bf2c6bb (diff) |
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/uapi')
-rw-r--r-- | include/uapi/linux/filter.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/uapi/linux/filter.h b/include/uapi/linux/filter.h index 3d7922433aba..9cfde6941099 100644 --- a/include/uapi/linux/filter.h +++ b/include/uapi/linux/filter.h | |||
@@ -127,7 +127,9 @@ struct sock_fprog { /* Required for SO_ATTACH_FILTER. */ | |||
127 | #define SKF_AD_RXHASH 32 | 127 | #define SKF_AD_RXHASH 32 |
128 | #define SKF_AD_CPU 36 | 128 | #define SKF_AD_CPU 36 |
129 | #define SKF_AD_ALU_XOR_X 40 | 129 | #define SKF_AD_ALU_XOR_X 40 |
130 | #define SKF_AD_MAX 44 | 130 | #define SKF_AD_VLAN_TAG 44 |
131 | #define SKF_AD_VLAN_TAG_PRESENT 48 | ||
132 | #define SKF_AD_MAX 52 | ||
131 | #define SKF_NET_OFF (-0x100000) | 133 | #define SKF_NET_OFF (-0x100000) |
132 | #define SKF_LL_OFF (-0x200000) | 134 | #define SKF_LL_OFF (-0x200000) |
133 | 135 | ||