[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <c2be1d959f0d710dbbb99392eeb190a81952307a.1574437486.git.petrm@mellanox.com>
Date: Fri, 22 Nov 2019 15:47:21 +0000
From: Petr Machata <petrm@...lanox.com>
To: "netdev@...r.kernel.org" <netdev@...r.kernel.org>
CC: Petr Machata <petrm@...lanox.com>,
"davem@...emloft.net" <davem@...emloft.net>,
Pablo Neira Ayuso <pablo@...filter.org>
Subject: [PATCH net-next] net: flow_dissector: Wrap unionized VLAN fields in a
struct
In commit a82055af5959 ("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: a82055af5959 ("netfilter: nft_payload: add VLAN offload support")
Signed-off-by: Petr Machata <petrm@...lanox.com>
---
include/net/flow_dissector.h | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/include/net/flow_dissector.h b/include/net/flow_dissector.h
index f06b0239c32b..b8c20e9f343e 100644
--- a/include/net/flow_dissector.h
+++ b/include/net/flow_dissector.h
@@ -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;
--
2.20.1
Powered by blists - more mailing lists