bridge: Allow set bridge ageing time when switchdev disabled
authorHaishuang Yan <yanhaishuang@cmss.chinamobile.com>
Tue, 29 Mar 2016 10:48:08 +0000 (18:48 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Apr 2016 06:42:05 +0000 (15:42 +0900)
[ Upstream commit 5e263f712691615fb802f06c98d7638c378f5d11 ]

When NET_SWITCHDEV=n, switchdev_port_attr_set will return -EOPNOTSUPP,
we should ignore this error code and continue to set the ageing time.

Fixes: c62987bbd8a1 ("bridge: push bridge setting ageing_time down to switchdev")
Signed-off-by: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
Acked-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/bridge/br_stp.c

index 0e658f47a5da1ec014e250ee221e07e09cb0b8aa..eff69cb270d229746b64b6373c276faf40596a11 100644 (file)
@@ -586,7 +586,7 @@ int br_set_ageing_time(struct net_bridge *br, u32 ageing_time)
        int err;
 
        err = switchdev_port_attr_set(br->dev, &attr);
-       if (err)
+       if (err && err != -EOPNOTSUPP)
                return err;
 
        br->ageing_time = t;