aboutsummaryrefslogtreecommitdiffstats
path: root/tools/net/bpf_exp.l
diff options
context:
space:
mode:
authorMichal Sekletar <msekleta@redhat.com>2015-03-24 14:48:41 +0100
committerDavid S. Miller <davem@davemloft.net>2015-03-24 15:25:15 -0400
commit27cd5452476978283decb19e429e81fc6c71e74b (patch)
treea147d4576190e18580589e6faaf08e1b7050ef2d /tools/net/bpf_exp.l
parentMerge branch 'cxgb4-fcoe' (diff)
downloadlinux-dev-27cd5452476978283decb19e429e81fc6c71e74b.tar.xz
linux-dev-27cd5452476978283decb19e429e81fc6c71e74b.zip
filter: introduce SKF_AD_VLAN_TPID BPF extension
If vlan offloading takes place then vlan header is removed from frame and its contents, both vlan_tci and vlan_proto, is available to user space via TPACKET interface. However, only vlan_tci can be used in BPF filters. This commit introduces a new BPF extension. It makes possible to load the value of vlan_proto (vlan TPID) to register A. Support for classic BPF and eBPF is being added, analogous to skb->protocol. Cc: Daniel Borkmann <daniel@iogearbox.net> Cc: Alexei Starovoitov <ast@plumgrid.com> Cc: Jiri Pirko <jpirko@redhat.com> Signed-off-by: Michal Sekletar <msekleta@redhat.com> Acked-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Alexei Starovoitov <ast@plumgrid.com> Reviewed-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/net/bpf_exp.l')
-rw-r--r--tools/net/bpf_exp.l2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/net/bpf_exp.l b/tools/net/bpf_exp.l
index 833a96611da6..c83af3fb77de 100644
--- a/tools/net/bpf_exp.l
+++ b/tools/net/bpf_exp.l
@@ -92,6 +92,8 @@ extern void yyerror(const char *str);
"#"?("cpu") { return K_CPU; }
"#"?("vlan_tci") { return K_VLANT; }
"#"?("vlan_pr") { return K_VLANP; }
+"#"?("vlan_avail") { return K_VLANP; }
+"#"?("vlan_tpid") { return K_VLANTPID; }
"#"?("rand") { return K_RAND; }
":" { return ':'; }