diff options
author | Tom Herbert <tom@herbertland.com> | 2015-06-04 09:16:43 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-06-04 15:44:31 -0700 |
commit | d34af823ff401c312541aa613c49ea4b872bde9e (patch) | |
tree | 40f0c64d98ef03659bf8ed530a649a3a54723acd /net/core | |
parent | 45b47fd00ca14df869979dbbe14324625ec93552 (diff) | |
download | op-kernel-dev-d34af823ff401c312541aa613c49ea4b872bde9e.zip op-kernel-dev-d34af823ff401c312541aa613c49ea4b872bde9e.tar.gz |
net: Add VLAN ID to flow_keys
In flow_dissector set vlan_id in flow_keys when VLAN is found.
Signed-off-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/flow_dissector.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c index 5348a46..5c66cb2 100644 --- a/net/core/flow_dissector.c +++ b/net/core/flow_dissector.c @@ -126,6 +126,7 @@ bool __skb_flow_dissect(const struct sk_buff *skb, struct flow_dissector_key_basic *key_basic; struct flow_dissector_key_addrs *key_addrs; struct flow_dissector_key_ports *key_ports; + struct flow_dissector_key_tags *key_tags; u8 ip_proto; if (!data) { @@ -246,6 +247,15 @@ flow_label: if (!vlan) return false; + if (skb_flow_dissector_uses_key(flow_dissector, + FLOW_DISSECTOR_KEY_VLANID)) { + key_tags = skb_flow_dissector_target(flow_dissector, + FLOW_DISSECTOR_KEY_VLANID, + target_container); + + key_tags->vlan_id = skb_vlan_tag_get_id(skb); + } + proto = vlan->h_vlan_encapsulated_proto; nhoff += sizeof(*vlan); goto again; @@ -645,6 +655,10 @@ static const struct flow_dissector_key flow_keys_dissector_keys[] = { .key_id = FLOW_DISSECTOR_KEY_PORTS, .offset = offsetof(struct flow_keys, ports), }, + { + .key_id = FLOW_DISSECTOR_KEY_VLANID, + .offset = offsetof(struct flow_keys, tags), + }, }; static const struct flow_dissector_key flow_keys_buf_dissector_keys[] = { |