Skip to content

Commit d1746d1

Browse files
pmachatadavem330
authored andcommitted
net: flow_dissector: Wrap unionized VLAN fields in a struct
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 <[email protected]> Reviewed-by: Jiri Pirko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 4bbb02f commit d1746d1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

include/net/flow_dissector.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,11 @@ struct flow_dissector_key_tags {
4949

5050
struct flow_dissector_key_vlan {
5151
union {
52-
u16 vlan_id:12,
53-
vlan_dei:1,
54-
vlan_priority:3;
52+
struct {
53+
u16 vlan_id:12,
54+
vlan_dei:1,
55+
vlan_priority:3;
56+
};
5557
__be16 vlan_tci;
5658
};
5759
__be16 vlan_tpid;

0 commit comments

Comments
 (0)