aboutsummaryrefslogtreecommitdiff
path: root/net/bridge/br_vlan.c
diff options
context:
space:
mode:
authorGravatar Nikolay Aleksandrov <nikolay@cumulusnetworks.com> 2020-03-17 14:08:36 +0200
committerGravatar David S. Miller <davem@davemloft.net> 2020-03-17 22:47:12 -0700
commit569da08228086ac6f7053d71c6cb713c1f115209 (patch)
treecccd412e56c23ec98a2ead61f057611f13f79af1 /net/bridge/br_vlan.c
parentnet: bridge: vlan options: add support for tunnel id dumping (diff)
downloadlinux-569da08228086ac6f7053d71c6cb713c1f115209.tar.gz
linux-569da08228086ac6f7053d71c6cb713c1f115209.tar.bz2
linux-569da08228086ac6f7053d71c6cb713c1f115209.zip
net: bridge: vlan options: add support for tunnel mapping set/del
This patch adds support for manipulating vlan/tunnel mappings. The tunnel ids are globally unique and are one per-vlan. There were two trickier issues - first in order to support vlan ranges we have to compute the current tunnel id in the following way: - base tunnel id (attr) + current vlan id - starting vlan id This is in line how the old API does vlan/tunnel mapping with ranges. We already have the vlan range present, so it's redundant to add another attribute for the tunnel range end. It's simply base tunnel id + vlan range. And second to support removing mappings we need an out-of-band way to tell the option manipulating function because there are no special/reserved tunnel id values, so we use a vlan flag to denote the operation is tunnel mapping removal. Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_vlan.c')
-rw-r--r--net/bridge/br_vlan.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/bridge/br_vlan.c b/net/bridge/br_vlan.c
index 09bfda47fbbf..24f524536be4 100644
--- a/net/bridge/br_vlan.c
+++ b/net/bridge/br_vlan.c
@@ -1839,6 +1839,7 @@ static const struct nla_policy br_vlan_db_policy[BRIDGE_VLANDB_ENTRY_MAX + 1] =
.len = sizeof(struct bridge_vlan_info) },
[BRIDGE_VLANDB_ENTRY_RANGE] = { .type = NLA_U16 },
[BRIDGE_VLANDB_ENTRY_STATE] = { .type = NLA_U8 },
+ [BRIDGE_VLANDB_ENTRY_TUNNEL_ID] = { .type = NLA_U32 },
};
static int br_vlan_rtm_process_one(struct net_device *dev,