diff options
author | Nikolay Aleksandrov <nikolay@nvidia.com> | 2021-07-19 19:06:34 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-07-20 14:41:20 +0200 |
commit | 47ecd2dbd8ec43125ea75d7d2e73c888cda8663f (patch) | |
tree | 5d4dae50fdfc847a1cf196e4eacf36c649d8aa89 /net/bridge/br_vlan.c | |
parent | net: bridge: multicast: include router port vlan id in notifications (diff) | |
download | linux-47ecd2dbd8ec43125ea75d7d2e73c888cda8663f.tar.xz linux-47ecd2dbd8ec43125ea75d7d2e73c888cda8663f.zip |
net: bridge: vlan: add support for global options
We can have two types of vlan options depending on context:
- per-device vlan options (split in per-bridge and per-port)
- global vlan options
The second type wasn't supported in the bridge until now, but we need
them for per-vlan multicast support, per-vlan STP support and other
options which require global vlan context. They are contained in the global
bridge vlan context even if the vlan is not configured on the bridge device
itself. This patch adds initial netlink attributes and support for setting
these global vlan options, they can only be set (RTM_NEWVLAN) and the
operation must use the bridge device. Since there are no such options yet
it shouldn't have any functional effect.
Signed-off-by: Nikolay Aleksandrov <nikolay@nvidia.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.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/net/bridge/br_vlan.c b/net/bridge/br_vlan.c index ab4969a4a380..dcb5acf783d2 100644 --- a/net/bridge/br_vlan.c +++ b/net/bridge/br_vlan.c @@ -2203,12 +2203,22 @@ static int br_vlan_rtm_process(struct sk_buff *skb, struct nlmsghdr *nlh, } nlmsg_for_each_attr(attr, nlh, sizeof(*bvm), rem) { - if (nla_type(attr) != BRIDGE_VLANDB_ENTRY) + switch (nla_type(attr)) { + case BRIDGE_VLANDB_ENTRY: + err = br_vlan_rtm_process_one(dev, attr, + nlh->nlmsg_type, + extack); + break; + case BRIDGE_VLANDB_GLOBAL_OPTIONS: + err = br_vlan_rtm_process_global_options(dev, attr, + nlh->nlmsg_type, + extack); + break; + default: continue; + } vlans++; - err = br_vlan_rtm_process_one(dev, attr, nlh->nlmsg_type, - extack); if (err) break; } |