summaryrefslogtreecommitdiffstats
path: root/net/bridge/br_multicast_eht.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/bridge/br_multicast_eht.c')
-rw-r--r--net/bridge/br_multicast_eht.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/bridge/br_multicast_eht.c b/net/bridge/br_multicast_eht.c
index ff9b3ba37cab..445768c8495f 100644
--- a/net/bridge/br_multicast_eht.c
+++ b/net/bridge/br_multicast_eht.c
@@ -127,6 +127,8 @@ static void __eht_destroy_host(struct net_bridge_group_eht_host *eht_host)
{
WARN_ON(!hlist_empty(&eht_host->set_entries));
+ br_multicast_eht_hosts_dec(eht_host->pg);
+
rb_erase(&eht_host->rb_node, &eht_host->pg->eht_host_tree);
RB_CLEAR_NODE(&eht_host->rb_node);
kfree(eht_host);
@@ -257,6 +259,9 @@ __eht_lookup_create_host(struct net_bridge_port_group *pg,
return this;
}
+ if (br_multicast_eht_hosts_over_limit(pg))
+ return NULL;
+
eht_host = kzalloc(sizeof(*eht_host), GFP_ATOMIC);
if (!eht_host)
return NULL;
@@ -269,6 +274,8 @@ __eht_lookup_create_host(struct net_bridge_port_group *pg,
rb_link_node(&eht_host->rb_node, parent, link);
rb_insert_color(&eht_host->rb_node, &pg->eht_host_tree);
+ br_multicast_eht_hosts_inc(pg);
+
return eht_host;
}