aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/l2/l2_fib.c
diff options
context:
space:
mode:
authorEyal Bari <ebari@cisco.com>2017-04-20 14:45:17 +0300
committerJohn Lo <loj@cisco.com>2017-05-03 13:48:11 +0000
commitafc47aa36f44d3f865c6e1e48f41eded366a85ac (patch)
tree8d9b9ef47ea524f965174d6b81260d1f418bb5d8 /src/vnet/l2/l2_fib.c
parente72be39cd0f498178fd62dfc0a0b0daa2b633f62 (diff)
L2FIB:flush interface learned macs on down
Change-Id: I80a723f55fcf2ecc3209a35e8297c88b45b1abfb Signed-off-by: Eyal Bari <ebari@cisco.com>
Diffstat (limited to 'src/vnet/l2/l2_fib.c')
-rw-r--r--src/vnet/l2/l2_fib.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/vnet/l2/l2_fib.c b/src/vnet/l2/l2_fib.c
index fadd79ebdf6..d8fcc319567 100644
--- a/src/vnet/l2/l2_fib.c
+++ b/src/vnet/l2/l2_fib.c
@@ -751,8 +751,7 @@ void
l2fib_flush_bd_mac (vlib_main_t * vm, u32 bd_index)
{
l2_bridge_domain_t *bd_config;
- vec_validate (l2input_main.bd_configs, bd_index);
- bd_config = vec_elt_at_index (l2input_main.bd_configs, bd_index);
+ bd_config = l2input_bd_config (bd_index);
bd_config->seq_num += 1;
l2fib_start_ager_scan (vm);
}
@@ -848,6 +847,16 @@ VLIB_CLI_COMMAND (l2fib_flush_mac_bd_cli, static) = {
};
/* *INDENT-ON* */
+clib_error_t *
+l2fib_sw_interface_up_down (vnet_main_t * vnm, u32 sw_if_index, u32 flags)
+{
+ l2_input_config_t *config = l2input_intf_config (sw_if_index);
+ if ((flags & VNET_SW_INTERFACE_FLAG_ADMIN_UP) == 0 && config->bridge)
+ l2fib_flush_int_mac (vnm->vlib_main, sw_if_index);
+ return 0;
+}
+
+VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION (l2fib_sw_interface_up_down);
BVT (clib_bihash) * get_mac_table (void)
{