aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge/br_fdb.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@linux-foundation.org>2007-04-09 15:57:54 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:28:47 -0400
commit9cf637473c8535b5abe27fee79254c2d552e042a (patch)
tree98d73249a2a75eaa23bbbc6c235eca0182f52a3d /net/bridge/br_fdb.c
parent3f890923182aeebc572f3818dd51c9014827e0ec (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_fdb.c')
-rw-r--r--net/bridge/br_fdb.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
index dd5a5d5fb280..22645e3edf23 100644
--- a/net/bridge/br_fdb.c
+++ b/net/bridge/br_fdb.c
@@ -135,7 +135,26 @@ void br_fdb_cleanup(unsigned long _data)
135 mod_timer(&br->gc_timer, jiffies + HZ/10); 135 mod_timer(&br->gc_timer, jiffies + HZ/10);
136} 136}
137 137
138/* Completely flush all dynamic entries in forwarding database.*/
139void br_fdb_flush(struct net_bridge *br)
140{
141 int i;
138 142
143 spin_lock_bh(&br->hash_lock);
144 for (i = 0; i < BR_HASH_SIZE; i++) {
145 struct net_bridge_fdb_entry *f;
146 struct hlist_node *h, *n;
147 hlist_for_each_entry_safe(f, h, n, &br->hash[i], hlist) {
148 if (!f->is_static)
149 fdb_delete(f);
150 }
151 }
152 spin_unlock_bh(&br->hash_lock);
153}
154
155/* Flush all entries refering to a specific port.
156 * if do_all is set also flush static entries
157 */
139void br_fdb_delete_by_port(struct net_bridge *br, 158void br_fdb_delete_by_port(struct net_bridge *br,
140 const struct net_bridge_port *p, 159 const struct net_bridge_port *p,
141 int do_all) 160 int do_all)