diff options
author | Eric Dumazet <edumazet@google.com> | 2013-07-19 23:07:16 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-07-20 01:12:42 -0400 |
commit | 1faabf2aab1fdaa1ace4e8c829d1b9cf7bfec2f1 (patch) | |
tree | c72272a0e485820f9d486012cd555f1a953bc977 | |
parent | 651e92716aaae60fc41b9652f54cb6803896e0da (diff) |
bridge: do not call setup_timer() multiple times
commit 9f00b2e7cf24 ("bridge: only expire the mdb entry when query is
received") added a nasty bug as an active timer can be reinitialized.
setup_timer() must be done once, no matter how many time mod_timer()
is called. br_multicast_new_group() is the right place to do this.
Reported-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Diagnosed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Tested-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Cc: Cong Wang <amwang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/bridge/br_multicast.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c index 69af490cce44..4b99c9a27044 100644 --- a/net/bridge/br_multicast.c +++ b/net/bridge/br_multicast.c | |||
@@ -619,6 +619,9 @@ rehash: | |||
619 | mp->br = br; | 619 | mp->br = br; |
620 | mp->addr = *group; | 620 | mp->addr = *group; |
621 | 621 | ||
622 | setup_timer(&mp->timer, br_multicast_group_expired, | ||
623 | (unsigned long)mp); | ||
624 | |||
622 | hlist_add_head_rcu(&mp->hlist[mdb->ver], &mdb->mhash[hash]); | 625 | hlist_add_head_rcu(&mp->hlist[mdb->ver], &mdb->mhash[hash]); |
623 | mdb->size++; | 626 | mdb->size++; |
624 | 627 | ||
@@ -1126,7 +1129,6 @@ static int br_ip4_multicast_query(struct net_bridge *br, | |||
1126 | if (!mp) | 1129 | if (!mp) |
1127 | goto out; | 1130 | goto out; |
1128 | 1131 | ||
1129 | setup_timer(&mp->timer, br_multicast_group_expired, (unsigned long)mp); | ||
1130 | mod_timer(&mp->timer, now + br->multicast_membership_interval); | 1132 | mod_timer(&mp->timer, now + br->multicast_membership_interval); |
1131 | mp->timer_armed = true; | 1133 | mp->timer_armed = true; |
1132 | 1134 | ||
@@ -1204,7 +1206,6 @@ static int br_ip6_multicast_query(struct net_bridge *br, | |||
1204 | if (!mp) | 1206 | if (!mp) |
1205 | goto out; | 1207 | goto out; |
1206 | 1208 | ||
1207 | setup_timer(&mp->timer, br_multicast_group_expired, (unsigned long)mp); | ||
1208 | mod_timer(&mp->timer, now + br->multicast_membership_interval); | 1209 | mod_timer(&mp->timer, now + br->multicast_membership_interval); |
1209 | mp->timer_armed = true; | 1210 | mp->timer_armed = true; |
1210 | 1211 | ||