Commit 544586f7 authored by Satish Ashok's avatar Satish Ashok Committed by David S. Miller

bridge: mcast: give fast leave precedence over multicast router and querier

When fast leave is configured on a bridge port and an IGMP leave is
received for a group, the group is not deleted immediately if there is
a router detected or if multicast querier is configured.
Ideally the group should be deleted immediately when fast leave is
configured.
Signed-off-by: default avatarSatish Ashok <sashok@cumulusnetworks.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent df356d5e
...@@ -1416,8 +1416,7 @@ br_multicast_leave_group(struct net_bridge *br, ...@@ -1416,8 +1416,7 @@ br_multicast_leave_group(struct net_bridge *br,
spin_lock(&br->multicast_lock); spin_lock(&br->multicast_lock);
if (!netif_running(br->dev) || if (!netif_running(br->dev) ||
(port && port->state == BR_STATE_DISABLED) || (port && port->state == BR_STATE_DISABLED))
timer_pending(&other_query->timer))
goto out; goto out;
mdb = mlock_dereference(br->mdb, br); mdb = mlock_dereference(br->mdb, br);
...@@ -1425,6 +1424,31 @@ br_multicast_leave_group(struct net_bridge *br, ...@@ -1425,6 +1424,31 @@ br_multicast_leave_group(struct net_bridge *br,
if (!mp) if (!mp)
goto out; goto out;
if (port && (port->flags & BR_MULTICAST_FAST_LEAVE)) {
struct net_bridge_port_group __rcu **pp;
for (pp = &mp->ports;
(p = mlock_dereference(*pp, br)) != NULL;
pp = &p->next) {
if (p->port != port)
continue;
rcu_assign_pointer(*pp, p->next);
hlist_del_init(&p->mglist);
del_timer(&p->timer);
call_rcu_bh(&p->rcu, br_multicast_free_pg);
br_mdb_notify(br->dev, port, group, RTM_DELMDB);
if (!mp->ports && !mp->mglist &&
netif_running(br->dev))
mod_timer(&mp->timer, jiffies);
}
goto out;
}
if (timer_pending(&other_query->timer))
goto out;
if (br->multicast_querier) { if (br->multicast_querier) {
__br_multicast_send_query(br, port, &mp->addr); __br_multicast_send_query(br, port, &mp->addr);
...@@ -1450,28 +1474,6 @@ br_multicast_leave_group(struct net_bridge *br, ...@@ -1450,28 +1474,6 @@ br_multicast_leave_group(struct net_bridge *br,
} }
} }
if (port && (port->flags & BR_MULTICAST_FAST_LEAVE)) {
struct net_bridge_port_group __rcu **pp;
for (pp = &mp->ports;
(p = mlock_dereference(*pp, br)) != NULL;
pp = &p->next) {
if (p->port != port)
continue;
rcu_assign_pointer(*pp, p->next);
hlist_del_init(&p->mglist);
del_timer(&p->timer);
call_rcu_bh(&p->rcu, br_multicast_free_pg);
br_mdb_notify(br->dev, port, group, RTM_DELMDB);
if (!mp->ports && !mp->mglist &&
netif_running(br->dev))
mod_timer(&mp->timer, jiffies);
}
goto out;
}
now = jiffies; now = jiffies;
time = now + br->multicast_last_member_count * time = now + br->multicast_last_member_count *
br->multicast_last_member_interval; br->multicast_last_member_interval;
......
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