From: Thomas Graf Date: Tue, 10 Jul 2012 22:29:19 +0000 (+0000) Subject: bridge: Fix enforcement of multicast hash_max limit X-Git-Tag: v3.6-rc1~125^2~157 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=036be6dbcfbe3da14be9b3463b94a5f79d8a2d71;p=platform%2Fkernel%2Flinux-3.10.git 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: Thomas Graf Signed-off-by: David S. Miller --- diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c index 2d9a066..2417434 100644 --- a/net/bridge/br_multicast.c +++ b/net/bridge/br_multicast.c @@ -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;