diff options
author | Stephen Hemminger <shemminger@linux-foundation.org> | 2007-04-09 15:57:54 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:28:47 -0400 |
commit | 9cf637473c8535b5abe27fee79254c2d552e042a (patch) | |
tree | 98d73249a2a75eaa23bbbc6c235eca0182f52a3d /net/bridge/br_sysfs_br.c | |
parent | 3f890923182aeebc572f3818dd51c9014827e0ec (diff) |
bridge: add sysfs hook to flush forwarding table
The RSTP daemon needs to be able to flush all dynamic forwarding
entries in the case of topology change.
This is a temporary interface. It will change to a netlink interface
before RSTP daemon is officially released.
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Diffstat (limited to 'net/bridge/br_sysfs_br.c')
-rw-r--r-- | net/bridge/br_sysfs_br.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/net/bridge/br_sysfs_br.c b/net/bridge/br_sysfs_br.c index 01a22ad0cc75..6cc5cfe665cd 100644 --- a/net/bridge/br_sysfs_br.c +++ b/net/bridge/br_sysfs_br.c | |||
@@ -309,6 +309,19 @@ static ssize_t store_group_addr(struct device *d, | |||
309 | static DEVICE_ATTR(group_addr, S_IRUGO | S_IWUSR, | 309 | static DEVICE_ATTR(group_addr, S_IRUGO | S_IWUSR, |
310 | show_group_addr, store_group_addr); | 310 | show_group_addr, store_group_addr); |
311 | 311 | ||
312 | static ssize_t store_flush(struct device *d, | ||
313 | struct device_attribute *attr, | ||
314 | const char *buf, size_t len) | ||
315 | { | ||
316 | struct net_bridge *br = to_bridge(d); | ||
317 | |||
318 | if (!capable(CAP_NET_ADMIN)) | ||
319 | return -EPERM; | ||
320 | |||
321 | br_fdb_flush(br); | ||
322 | return len; | ||
323 | } | ||
324 | static DEVICE_ATTR(flush, S_IWUSR, NULL, store_flush); | ||
312 | 325 | ||
313 | static struct attribute *bridge_attrs[] = { | 326 | static struct attribute *bridge_attrs[] = { |
314 | &dev_attr_forward_delay.attr, | 327 | &dev_attr_forward_delay.attr, |
@@ -328,6 +341,7 @@ static struct attribute *bridge_attrs[] = { | |||
328 | &dev_attr_topology_change_timer.attr, | 341 | &dev_attr_topology_change_timer.attr, |
329 | &dev_attr_gc_timer.attr, | 342 | &dev_attr_gc_timer.attr, |
330 | &dev_attr_group_addr.attr, | 343 | &dev_attr_group_addr.attr, |
344 | &dev_attr_flush.attr, | ||
331 | NULL | 345 | NULL |
332 | }; | 346 | }; |
333 | 347 | ||