Skip to content

Commit

Permalink
bridge: Fix enforcement of multicast hash_max limit
Browse files Browse the repository at this point in the history
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: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Thomas Graf authored and David S. Miller committed Jul 17, 2012
1 parent 9c64508 commit 036be6d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions net/bridge/br_multicast.c
Original file line number Diff line number Diff line change
Expand Up @@ -540,10 +540,11 @@ static struct net_bridge_mdb_entry *br_multicast_get_group(

if (mdb->size >= max) {
max *= 2;
if (unlikely(max >= br->hash_max)) {
br_warn(br, "Multicast hash table maximum "
"reached, disabling snooping: %s, %d\n",
port ? port->dev->name : br->dev->name, max);
if (unlikely(max > br->hash_max)) {
br_warn(br, "Multicast hash table maximum of %d "
"reached, disabling snooping: %s\n",
br->hash_max,
port ? port->dev->name : br->dev->name);
err = -E2BIG;
disable:
br->multicast_disabled = 1;
Expand Down

0 comments on commit 036be6d

Please sign in to comment.