summaryrefslogtreecommitdiff
path: root/net/bridge
diff options
context:
space:
mode:
authorElad Raz <eladr@mellanox.com>2016-01-06 15:01:04 +0300
committerDavid S. Miller <davem@davemloft.net>2016-01-06 22:42:40 +0300
commit08474cc1e6ea71237cab7e4a651a623c9dea1084 (patch)
treef2e0b8924e821aaaf830fc7bc5deb420813bd981 /net/bridge
parent00ce3a15d811978fcb204a1a3f5f8c059096fa5e (diff)
downloadlinux-08474cc1e6ea71237cab7e4a651a623c9dea1084.tar.xz
bridge: Propagate vlan add failure to user
Disallow adding interfaces to a bridge when vlan filtering operation failed. Send the failure code to the user. Signed-off-by: Elad Raz <eladr@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge')
-rw-r--r--net/bridge/br_if.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index 8d1d4a22c50d..c367b3e1b5ac 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -511,8 +511,11 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
if (br_fdb_insert(br, p, dev->dev_addr, 0))
netdev_err(dev, "failed insert local address bridge forwarding table\n");
- if (nbp_vlan_init(p))
+ err = nbp_vlan_init(p);
+ if (err) {
netdev_err(dev, "failed to initialize vlan filtering on this port\n");
+ goto err6;
+ }
spin_lock_bh(&br->lock);
changed_addr = br_stp_recalculate_bridge_id(br);
@@ -533,6 +536,12 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
return 0;
+err6:
+ list_del_rcu(&p->list);
+ br_fdb_delete_by_port(br, p, 0, 1);
+ nbp_update_port_count(br);
+ netdev_upper_dev_unlink(dev, br->dev);
+
err5:
dev->priv_flags &= ~IFF_BRIDGE_PORT;
netdev_rx_handler_unregister(dev);