diff options
author | Nikolay Aleksandrov <nikolay@nvidia.com> | 2021-01-26 11:35:32 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-01-27 17:40:35 -0800 |
commit | 89268b056ed116e13ba39f46481ad8bf5eef7bc4 (patch) | |
tree | 257ab964c03ca0136ac4ebddf7bc78f327a36e30 /net/bridge/br_multicast_eht.c | |
parent | 1d96006dccf0994dd91f327f59493afd6398b01d (diff) |
net: bridge: multicast: add per-port EHT hosts limit
Add a default limit of 512 for number of tracked EHT hosts per-port.
Signed-off-by: Nikolay Aleksandrov <nikolay@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/bridge/br_multicast_eht.c')
-rw-r--r-- | net/bridge/br_multicast_eht.c | 7 |
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; } |