Re: bpf filter : support for vlan tag
flat view
From: Ani Sinha <hidden>
Date: 2012-10-19 18:32:10
how about this? On Tue, Oct 16, 2012 at 4:28 AM, Eric Dumazet [off-list ref] wrote:
quoted hunk ↗ jump to hunk
@@ -341,6 +342,12 @@ load_b: case BPF_S_ANC_CPU: A = raw_smp_processor_id(); continue; + case BPF_S_ANC_VLAN_TAG: + A = vlan_tx_tag_get(skb); + continue; + case BPF_S_ANC_VLAN_TAG_PRESENT: + A = !!vlan_tx_tag_present(skb); + continue; case BPF_S_ANC_NLATTR: { struct nlattr *nla;
+ case BPF_S_ANC_VLAN_TAG:
+ if (!vlan_tx_tag_present(skb)) {
+ return 0;
+ }
+ A = vlan_tx_tag_get(skb);
+ continue;
+ case BPF_S_ANC_VLAN_TAG_PRESENT :
+ A = !! vlan_tx_tag_present(skb);
+ continue;
Now, is there any particular reason we are not using clan_get_tag() api?
Thanks
ani