diff options
author | Nikolay Aleksandrov <nikolay@cumulusnetworks.com> | 2015-06-23 08:28:16 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-06-24 08:40:55 -0400 |
commit | 1ea2d020ba477cb7011a7174e8501a9e04a325d4 (patch) | |
tree | 2e32130a1c69c146ee95171dd601f2fcf891f3eb /net/bridge/br_fdb.c | |
parent | 9aa66382163e784acac0ce3580ed202d9a56d1ac (diff) |
bridge: vlan: flush the dynamically learned entries on port vlan delete
Add a new argument to br_fdb_delete_by_port which allows to specify a
vid to match when flushing entries and use it in nbp_vlan_delete() to
flush the dynamically learned entries of the vlan/port pair when removing
a vlan from a port. Before this patch only the local mac was being
removed and the dynamically learned ones were left to expire.
Note that the do_all argument is still respected and if specified, the
vid will be ignored.
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_fdb.c')
-rw-r--r-- | net/bridge/br_fdb.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c index be84b7e5a3da..9e9875da0a4f 100644 --- a/net/bridge/br_fdb.c +++ b/net/bridge/br_fdb.c | |||
@@ -330,9 +330,11 @@ void br_fdb_flush(struct net_bridge *br) | |||
330 | 330 | ||
331 | /* Flush all entries referring to a specific port. | 331 | /* Flush all entries referring to a specific port. |
332 | * if do_all is set also flush static entries | 332 | * if do_all is set also flush static entries |
333 | * if vid is set delete all entries that match the vlan_id | ||
333 | */ | 334 | */ |
334 | void br_fdb_delete_by_port(struct net_bridge *br, | 335 | void br_fdb_delete_by_port(struct net_bridge *br, |
335 | const struct net_bridge_port *p, | 336 | const struct net_bridge_port *p, |
337 | u16 vid, | ||
336 | int do_all) | 338 | int do_all) |
337 | { | 339 | { |
338 | int i; | 340 | int i; |
@@ -347,8 +349,9 @@ void br_fdb_delete_by_port(struct net_bridge *br, | |||
347 | if (f->dst != p) | 349 | if (f->dst != p) |
348 | continue; | 350 | continue; |
349 | 351 | ||
350 | if (f->is_static && !do_all) | 352 | if (!do_all) |
351 | continue; | 353 | if (f->is_static || (vid && f->vlan_id != vid)) |
354 | continue; | ||
352 | 355 | ||
353 | if (f->is_local) | 356 | if (f->is_local) |
354 | fdb_delete_local(br, p, f); | 357 | fdb_delete_local(br, p, f); |