Commit 036be6db authored by Thomas Graf's avatar Thomas Graf Committed by David S. Miller

bridge: Fix enforcement of multicast hash_max limit

The hash size is doubled when it needs to grow and compared against
hash_max. The >= comparison will limit the hash table size to half
of what is expected i.e. the default 512 hash_max will not allow
the hash table to grow larger than 256.

Also print the hash table limit instead of the desirable size when
the limit is reached.
Signed-off-by: default avatarThomas Graf <tgraf@suug.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9c64508a
...@@ -540,10 +540,11 @@ static struct net_bridge_mdb_entry *br_multicast_get_group( ...@@ -540,10 +540,11 @@ static struct net_bridge_mdb_entry *br_multicast_get_group(
if (mdb->size >= max) { if (mdb->size >= max) {
max *= 2; max *= 2;
if (unlikely(max >= br->hash_max)) { if (unlikely(max > br->hash_max)) {
br_warn(br, "Multicast hash table maximum " br_warn(br, "Multicast hash table maximum of %d "
"reached, disabling snooping: %s, %d\n", "reached, disabling snooping: %s\n",
port ? port->dev->name : br->dev->name, max); br->hash_max,
port ? port->dev->name : br->dev->name);
err = -E2BIG; err = -E2BIG;
disable: disable:
br->multicast_disabled = 1; br->multicast_disabled = 1;
......
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