Skip to content

Commit 7470558

Browse files
Nikolay Aleksandrovdavem330
authored andcommitted
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: 085b53c ("net: bridge: mcast: add sg_port rhashtable") Signed-off-by: Nikolay Aleksandrov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent e0f9956 commit 7470558

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

net/bridge/br_multicast.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -590,17 +590,18 @@ void br_multicast_del_pg(struct net_bridge_mdb_entry *mp,
590590
struct net_bridge_group_src *ent;
591591
struct hlist_node *tmp;
592592

593-
rhashtable_remove_fast(&br->sg_port_tbl, &pg->rhnode,
594-
br_sg_port_rht_params);
595593
rcu_assign_pointer(*pp, pg->next);
596594
hlist_del_init(&pg->mglist);
597595
hlist_for_each_entry_safe(ent, tmp, &pg->src_list, node)
598596
br_multicast_del_group_src(ent);
599597
br_mdb_notify(br->dev, mp, pg, RTM_DELMDB);
600-
if (!br_multicast_is_star_g(&mp->addr))
598+
if (!br_multicast_is_star_g(&mp->addr)) {
599+
rhashtable_remove_fast(&br->sg_port_tbl, &pg->rhnode,
600+
br_sg_port_rht_params);
601601
br_multicast_sg_del_exclude_ports(mp);
602-
else
602+
} else {
603603
br_multicast_star_g_handle_mode(pg, MCAST_INCLUDE);
604+
}
604605
hlist_add_head(&pg->mcast_gc.gc_node, &br->mcast_gc_list);
605606
queue_work(system_long_wq, &br->mcast_gc_work);
606607

0 commit comments

Comments
 (0)