diff options
author | stephen hemminger <stephen@networkplumber.org> | 2013-05-02 10:23:28 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-05-03 16:08:58 -0400 |
commit | 83401eb4990ff6af55aeed8f49681558544192e6 (patch) | |
tree | 03ffd894cf160fdd0f87e63a4136810cf6275e2b /net/bridge | |
parent | 488fc9af8267d0cd9036bc9db9f5dbbfde6de208 (diff) |
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 <jerry.kang@samsung.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge')
-rw-r--r-- | net/bridge/br_stp_timer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/bridge/br_stp_timer.c b/net/bridge/br_stp_timer.c index c3530a81a33b..950663d4d330 100644 --- a/net/bridge/br_stp_timer.c +++ b/net/bridge/br_stp_timer.c | |||
@@ -107,7 +107,7 @@ static void br_tcn_timer_expired(unsigned long arg) | |||
107 | 107 | ||
108 | br_debug(br, "tcn timer expired\n"); | 108 | br_debug(br, "tcn timer expired\n"); |
109 | spin_lock(&br->lock); | 109 | spin_lock(&br->lock); |
110 | if (br->dev->flags & IFF_UP) { | 110 | if (!br_is_root_bridge(br) && (br->dev->flags & IFF_UP)) { |
111 | br_transmit_tcn(br); | 111 | br_transmit_tcn(br); |
112 | 112 | ||
113 | mod_timer(&br->tcn_timer,jiffies + br->bridge_hello_time); | 113 | mod_timer(&br->tcn_timer,jiffies + br->bridge_hello_time); |