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>
This commit is contained in:
Ian Wilson 2015-09-24 11:20:11 -07:00 committed by David S. Miller
parent 8f35043729
commit 34c2d9fb04
1 changed files with 4 additions and 9 deletions

View File

@ -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;
if (t < BR_MIN_FORWARD_DELAY || t > BR_MAX_FORWARD_DELAY)
return -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;
__br_set_forward_delay(br, t);
err = 0;
unlock:
spin_unlock_bh(&br->lock);
return err;
return 0;
}