]> git.baikalelectronics.ru Git - kernel.git/commit
net: filter: add vlan tag access
authorEric Dumazet <edumazet@google.com>
Sat, 27 Oct 2012 02:26:17 +0000 (02:26 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 31 Oct 2012 18:00:15 +0000 (14:00 -0400)
commit98f4689e74fdcb928d7c203e5267c54de4f00f4f
treec73f4d2827d3b58b4866488a35b4b462e52713ba
parentbd13df77e6ab9931b3a75343cb510cf743561dd2
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>
include/linux/filter.h
include/uapi/linux/filter.h
net/core/filter.c