Commit 1faabf2a authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

bridge: do not call setup_timer() multiple times

commit 9f00b2e7 ("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: default avatarSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Diagnosed-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Tested-by: default avatarSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Cc: Cong Wang <amwang@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 651e9271
......@@ -619,6 +619,9 @@ struct net_bridge_mdb_entry *br_multicast_new_group(struct net_bridge *br,
mp->br = br;
mp->addr = *group;
setup_timer(&mp->timer, br_multicast_group_expired,
(unsigned long)mp);
hlist_add_head_rcu(&mp->hlist[mdb->ver], &mdb->mhash[hash]);
mdb->size++;
......@@ -1126,7 +1129,6 @@ static int br_ip4_multicast_query(struct net_bridge *br,
if (!mp)
goto out;
setup_timer(&mp->timer, br_multicast_group_expired, (unsigned long)mp);
mod_timer(&mp->timer, now + br->multicast_membership_interval);
mp->timer_armed = true;
......@@ -1204,7 +1206,6 @@ static int br_ip6_multicast_query(struct net_bridge *br,
if (!mp)
goto out;
setup_timer(&mp->timer, br_multicast_group_expired, (unsigned long)mp);
mod_timer(&mp->timer, now + br->multicast_membership_interval);
mp->timer_armed = true;
......
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