Commit 6d18c732 authored by Xin Long's avatar Xin Long Committed by David S. Miller

bridge: start hello_timer when enabling KERNEL_STP in br_stp_start

Since commit 76b91c32 ("bridge: stp: when using userspace stp stop
kernel hello and hold timers"), bridge would not start hello_timer if
stp_enabled is not KERNEL_STP when br_dev_open.

The problem is even if users set stp_enabled with KERNEL_STP later,
the timer will still not be started. It causes that KERNEL_STP can
not really work. Users have to re-ifup the bridge to avoid this.

This patch is to fix it by starting br->hello_timer when enabling
KERNEL_STP in br_stp_start.

As an improvement, it's also to start hello_timer again only when
br->stp_enabled is KERNEL_STP in br_hello_timer_expired, there is
no reason to start the timer again when it's NO_STP.

Fixes: 76b91c32 ("bridge: stp: when using userspace stp stop kernel hello and hold timers")
Reported-by: default avatarHaidong Li <>
Signed-off-by: default avatarXin Long <>
Acked-by: default avatarNikolay Aleksandrov <>
Reviewed-by: default avatarIvan Vecera <>
Signed-off-by: default avatarDavid S. Miller <>
parent fe0cd8ca
......@@ -179,6 +179,7 @@ static void br_stp_start(struct net_bridge *br)
br_debug(br, "using kernel STP\n");
/* To start timers on any ports left in blocking */
mod_timer(&br->hello_timer, jiffies + br->hello_time);
......@@ -40,7 +40,7 @@ static void br_hello_timer_expired(unsigned long arg)
if (br->dev->flags & IFF_UP) {
if (br->stp_enabled != BR_USER_STP)
if (br->stp_enabled == BR_KERNEL_STP)
round_jiffies(jiffies + br->hello_time));
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment