summaryrefslogtreecommitdiffstats
path: root/net/bridge/br_stp.c
diff options
context:
space:
mode:
authorIan Wilson <iwilson@brocade.com>2015-09-24 11:20:11 -0700
committerDavid S. Miller <davem@davemloft.net>2015-09-27 19:09:38 -0700
commit34c2d9fb0498c066afbe610b15e18995fd8be792 (patch)
treea8ce325c4d45424a93ff8c5f83d3c94c8d479169 /net/bridge/br_stp.c
parent8f3504372963fb65d2386f8a2210a557d7cc01d9 (diff)
downloadlinux-34c2d9fb0498c066afbe610b15e18995fd8be792.tar.gz
linux-34c2d9fb0498c066afbe610b15e18995fd8be792.tar.bz2
linux-34c2d9fb0498c066afbe610b15e18995fd8be792.zip
bridge: Allow forward delay to be cfgd when STP enabled
Allow bridge forward delay to be configured when Spanning Tree is enabled. Signed-off-by: Ian Wilson <iwilson@brocade.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_stp.c')
-rw-r--r--net/bridge/br_stp.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/net/bridge/br_stp.c b/net/bridge/br_stp.c
index ed74ffaa851f..3a7392e6010e 100644
--- a/net/bridge/br_stp.c
+++ b/net/bridge/br_stp.c
@@ -576,17 +576,12 @@ void __br_set_forward_delay(struct net_bridge *br, unsigned long t)
int br_set_forward_delay(struct net_bridge *br, unsigned long val)
{
unsigned long t = clock_t_to_jiffies(val);
- int err = -ERANGE;
- spin_lock_bh(&br->lock);
- if (br->stp_enabled != BR_NO_STP &&
- (t < BR_MIN_FORWARD_DELAY || t > BR_MAX_FORWARD_DELAY))
- goto unlock;
+ if (t < BR_MIN_FORWARD_DELAY || t > BR_MAX_FORWARD_DELAY)
+ return -ERANGE;
+ spin_lock_bh(&br->lock);
__br_set_forward_delay(br, t);
- err = 0;
-
-unlock:
spin_unlock_bh(&br->lock);
- return err;
+ return 0;
}