diff options
author | Horatiu Vultur <horatiu.vultur@microchip.com> | 2020-04-26 15:22:08 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-04-27 11:40:25 -0700 |
commit | 419dba8a49d7cc355e5b495d20dea8217369ed63 (patch) | |
tree | 4e63a0779364f24e8907eade08443338123a2f78 /net/bridge/br_netlink.c | |
parent | 6536993371fab3de4e8379649b60e94d03e6ff37 (diff) | |
download | linux-riscv-419dba8a49d7cc355e5b495d20dea8217369ed63.tar.gz linux-riscv-419dba8a49d7cc355e5b495d20dea8217369ed63.tar.bz2 linux-riscv-419dba8a49d7cc355e5b495d20dea8217369ed63.zip |
net: bridge: Add checks for enabling the STP.
It is not possible to have the MRP and STP running at the same time on the
bridge, therefore add check when enabling the STP to check if MRP is already
enabled. In that case return error.
Reviewed-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_netlink.c')
-rw-r--r-- | net/bridge/br_netlink.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c index 1a5e681a626a..a774e19c41bb 100644 --- a/net/bridge/br_netlink.c +++ b/net/bridge/br_netlink.c @@ -1109,7 +1109,9 @@ static int br_changelink(struct net_device *brdev, struct nlattr *tb[], if (data[IFLA_BR_STP_STATE]) { u32 stp_enabled = nla_get_u32(data[IFLA_BR_STP_STATE]); - br_stp_set_enabled(br, stp_enabled); + err = br_stp_set_enabled(br, stp_enabled, extack); + if (err) + return err; } if (data[IFLA_BR_PRIORITY]) { |