Skip to content

Commit 83401eb

Browse files
shemmingerdavem330
authored andcommitted
bridge: fix race with topology change timer
A bridge should only send topology change notice if it is not the root bridge. It is possible for message age timer to elect itself as a new root bridge, and still have a topology change timer running but waiting for bridge lock on other CPU. Solve the race by checking if we are root bridge before continuing. This was the root cause of the cases where br_send_tcn_bpdu would OOPS. Reported-by: JerryKang <[email protected]> Signed-off-by: Stephen Hemminger <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 488fc9a commit 83401eb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/bridge/br_stp_timer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ static void br_tcn_timer_expired(unsigned long arg)
107107

108108
br_debug(br, "tcn timer expired\n");
109109
spin_lock(&br->lock);
110-
if (br->dev->flags & IFF_UP) {
110+
if (!br_is_root_bridge(br) && (br->dev->flags & IFF_UP)) {
111111
br_transmit_tcn(br);
112112

113113
mod_timer(&br->tcn_timer,jiffies + br->bridge_hello_time);

0 commit comments

Comments
 (0)