summaryrefslogtreecommitdiff
path: root/net/dsa/slave.c
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2015-03-25 08:08:37 -0700
committerDavid S. Miller <davem@davemloft.net>2015-03-25 14:04:57 -0400
commitb06b107a4c190299e9e3f8dbcccfc7fe9e10c8cb (patch)
tree9bc9276a6688936777f45c39488d3f0b34d85d9a /net/dsa/slave.c
parentac110f4954252b7bbe66268c78c8ece7ac2569b9 (diff)
net: dsa: Handle non-bridge master change
Master change notifications may occur other than when joining or leaving a bridge, for example when being added to or removed from a bond or Open vSwitch. In that case, do nothing instead of asking the switch driver to remove a port from a bridge that it didn't join. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/slave.c')
-rw-r--r--net/dsa/slave.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index f0af7aa331c1..39555f3f263b 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -830,12 +830,13 @@ static bool dsa_slave_dev_check(struct net_device *dev)
static int dsa_slave_master_changed(struct net_device *dev)
{
struct net_device *master = netdev_master_upper_dev_get(dev);
+ struct dsa_slave_priv *p = netdev_priv(dev);
int err = 0;
if (master && master->rtnl_link_ops &&
!strcmp(master->rtnl_link_ops->kind, "bridge"))
err = dsa_slave_bridge_port_join(dev, master);
- else
+ else if (dsa_port_is_bridged(p))
err = dsa_slave_bridge_port_leave(dev);
return err;