diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2010-02-27 14:41:50 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-28 03:49:46 -0500 |
commit | 561f1103a2b70de7e06e1e7fd072a5b142a4278c (patch) | |
tree | 219508a45a357c6dbd5e2fdf4924a474a6bab356 /net/bridge/br_sysfs_br.c | |
parent | 0909e11758bd28848aeb6646e021ec1e031a3f0f (diff) |
bridge: Add multicast_snooping sysfs toggle
This patch allows the user to disable IGMP snooping completely
through a sysfs toggle. It also allows the user to reenable
snooping when it has been automatically disabled due to hash
collisions. If the collisions have not been resolved however
the system will refuse to reenable snooping.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_sysfs_br.c')
-rw-r--r-- | net/bridge/br_sysfs_br.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/net/bridge/br_sysfs_br.c b/net/bridge/br_sysfs_br.c index cb742016db21..0ab288332fc5 100644 --- a/net/bridge/br_sysfs_br.c +++ b/net/bridge/br_sysfs_br.c | |||
@@ -361,6 +361,23 @@ static ssize_t store_multicast_router(struct device *d, | |||
361 | } | 361 | } |
362 | static DEVICE_ATTR(multicast_router, S_IRUGO | S_IWUSR, show_multicast_router, | 362 | static DEVICE_ATTR(multicast_router, S_IRUGO | S_IWUSR, show_multicast_router, |
363 | store_multicast_router); | 363 | store_multicast_router); |
364 | |||
365 | static ssize_t show_multicast_snooping(struct device *d, | ||
366 | struct device_attribute *attr, | ||
367 | char *buf) | ||
368 | { | ||
369 | struct net_bridge *br = to_bridge(d); | ||
370 | return sprintf(buf, "%d\n", !br->multicast_disabled); | ||
371 | } | ||
372 | |||
373 | static ssize_t store_multicast_snooping(struct device *d, | ||
374 | struct device_attribute *attr, | ||
375 | const char *buf, size_t len) | ||
376 | { | ||
377 | return store_bridge_parm(d, buf, len, br_multicast_toggle); | ||
378 | } | ||
379 | static DEVICE_ATTR(multicast_snooping, S_IRUGO | S_IWUSR, | ||
380 | show_multicast_snooping, store_multicast_snooping); | ||
364 | #endif | 381 | #endif |
365 | 382 | ||
366 | static struct attribute *bridge_attrs[] = { | 383 | static struct attribute *bridge_attrs[] = { |
@@ -384,6 +401,7 @@ static struct attribute *bridge_attrs[] = { | |||
384 | &dev_attr_flush.attr, | 401 | &dev_attr_flush.attr, |
385 | #ifdef CONFIG_BRIDGE_IGMP_SNOOPING | 402 | #ifdef CONFIG_BRIDGE_IGMP_SNOOPING |
386 | &dev_attr_multicast_router.attr, | 403 | &dev_attr_multicast_router.attr, |
404 | &dev_attr_multicast_snooping.attr, | ||
387 | #endif | 405 | #endif |
388 | NULL | 406 | NULL |
389 | }; | 407 | }; |