diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2010-02-27 14:41:49 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-28 03:49:45 -0500 |
commit | 0909e11758bd28848aeb6646e021ec1e031a3f0f (patch) | |
tree | a4ae57a59c6ff52f013bbfc29594715c383300d6 /net/bridge/br_sysfs_br.c | |
parent | c4fcb78cf8ae55667809e54e54872a21025dd073 (diff) |
bridge: Add multicast_router sysfs entries
This patch allows the user to forcibly enable/disable ports as
having multicast routers attached. A port with a multicast router
will receive all multicast traffic.
The value 0 disables it completely. The default is 1 which lets
the system automatically detect the presence of routers (currently
this is limited to picking up queries), and 2 means that the port
will always receive all multicast traffic.
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 | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/net/bridge/br_sysfs_br.c b/net/bridge/br_sysfs_br.c index bee4f300d0c8..cb742016db21 100644 --- a/net/bridge/br_sysfs_br.c +++ b/net/bridge/br_sysfs_br.c | |||
@@ -345,6 +345,24 @@ static ssize_t store_flush(struct device *d, | |||
345 | } | 345 | } |
346 | static DEVICE_ATTR(flush, S_IWUSR, NULL, store_flush); | 346 | static DEVICE_ATTR(flush, S_IWUSR, NULL, store_flush); |
347 | 347 | ||
348 | #ifdef CONFIG_BRIDGE_IGMP_SNOOPING | ||
349 | static ssize_t show_multicast_router(struct device *d, | ||
350 | struct device_attribute *attr, char *buf) | ||
351 | { | ||
352 | struct net_bridge *br = to_bridge(d); | ||
353 | return sprintf(buf, "%d\n", br->multicast_router); | ||
354 | } | ||
355 | |||
356 | static ssize_t store_multicast_router(struct device *d, | ||
357 | struct device_attribute *attr, | ||
358 | const char *buf, size_t len) | ||
359 | { | ||
360 | return store_bridge_parm(d, buf, len, br_multicast_set_router); | ||
361 | } | ||
362 | static DEVICE_ATTR(multicast_router, S_IRUGO | S_IWUSR, show_multicast_router, | ||
363 | store_multicast_router); | ||
364 | #endif | ||
365 | |||
348 | static struct attribute *bridge_attrs[] = { | 366 | static struct attribute *bridge_attrs[] = { |
349 | &dev_attr_forward_delay.attr, | 367 | &dev_attr_forward_delay.attr, |
350 | &dev_attr_hello_time.attr, | 368 | &dev_attr_hello_time.attr, |
@@ -364,6 +382,9 @@ static struct attribute *bridge_attrs[] = { | |||
364 | &dev_attr_gc_timer.attr, | 382 | &dev_attr_gc_timer.attr, |
365 | &dev_attr_group_addr.attr, | 383 | &dev_attr_group_addr.attr, |
366 | &dev_attr_flush.attr, | 384 | &dev_attr_flush.attr, |
385 | #ifdef CONFIG_BRIDGE_IGMP_SNOOPING | ||
386 | &dev_attr_multicast_router.attr, | ||
387 | #endif | ||
367 | NULL | 388 | NULL |
368 | }; | 389 | }; |
369 | 390 | ||