Skip to content

Commit

Permalink
net: flow_dissector: Wrap unionized VLAN fields in a struct
Browse files Browse the repository at this point in the history
In commit a82055a ("netfilter: nft_payload: add VLAN offload
support"), VLAN fields in struct flow_dissector_key_vlan were unionized
with the intention of introducing another field that covered the whole TCI
header. However without a wrapping struct the subfields end up sharing the
same bits. As a result, "tc filter add ... flower vlan_id 14" specifies not
only vlan_id, but also vlan_priority.

Fix by wrapping the individual VLAN fields in a struct.

Fixes: a82055a ("netfilter: nft_payload: add VLAN offload support")
Signed-off-by: Petr Machata <petrm@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Petr Machata authored and David S. Miller committed Nov 22, 2019
1 parent 4bbb02f commit d1746d1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions include/net/flow_dissector.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,11 @@ struct flow_dissector_key_tags {

struct flow_dissector_key_vlan {
union {
u16 vlan_id:12,
vlan_dei:1,
vlan_priority:3;
struct {
u16 vlan_id:12,
vlan_dei:1,
vlan_priority:3;
};
__be16 vlan_tci;
};
__be16 vlan_tpid;
Expand Down

0 comments on commit d1746d1

Please sign in to comment.