Commit 74705582 authored by Nikolay Aleksandrov's avatar Nikolay Aleksandrov Committed by David S. Miller

net: bridge: mcast: remove only S,G port groups from sg_port hash

We should remove a group from the sg_port hash only if it's an S,G
entry. This makes it correct and more symmetric with group add. Also
since *,G groups are not added to that hash we can hide a bug.

Fixes: 085b53c8 ("net: bridge: mcast: add sg_port rhashtable")
Signed-off-by: default avatarNikolay Aleksandrov <nikolay@nvidia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e0f9956a
...@@ -590,17 +590,18 @@ void br_multicast_del_pg(struct net_bridge_mdb_entry *mp, ...@@ -590,17 +590,18 @@ void br_multicast_del_pg(struct net_bridge_mdb_entry *mp,
struct net_bridge_group_src *ent; struct net_bridge_group_src *ent;
struct hlist_node *tmp; struct hlist_node *tmp;
rhashtable_remove_fast(&br->sg_port_tbl, &pg->rhnode,
br_sg_port_rht_params);
rcu_assign_pointer(*pp, pg->next); rcu_assign_pointer(*pp, pg->next);
hlist_del_init(&pg->mglist); hlist_del_init(&pg->mglist);
hlist_for_each_entry_safe(ent, tmp, &pg->src_list, node) hlist_for_each_entry_safe(ent, tmp, &pg->src_list, node)
br_multicast_del_group_src(ent); br_multicast_del_group_src(ent);
br_mdb_notify(br->dev, mp, pg, RTM_DELMDB); br_mdb_notify(br->dev, mp, pg, RTM_DELMDB);
if (!br_multicast_is_star_g(&mp->addr)) if (!br_multicast_is_star_g(&mp->addr)) {
rhashtable_remove_fast(&br->sg_port_tbl, &pg->rhnode,
br_sg_port_rht_params);
br_multicast_sg_del_exclude_ports(mp); br_multicast_sg_del_exclude_ports(mp);
else } else {
br_multicast_star_g_handle_mode(pg, MCAST_INCLUDE); br_multicast_star_g_handle_mode(pg, MCAST_INCLUDE);
}
hlist_add_head(&pg->mcast_gc.gc_node, &br->mcast_gc_list); hlist_add_head(&pg->mcast_gc.gc_node, &br->mcast_gc_list);
queue_work(system_long_wq, &br->mcast_gc_work); queue_work(system_long_wq, &br->mcast_gc_work);
......
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