aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/l2/l2_input.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2018-09-06 09:50:26 -0700
committerJohn Lo <loj@cisco.com>2018-09-08 14:51:48 +0000
commit3b81a1e5f205482b8ea30edbfd39559c4368ac4d (patch)
tree345ff2e3d599502852512180e95f21c76ec31f48 /src/vnet/l2/l2_input.c
parent3348a4cf070b90a9c23bbc0b3752fa2801f832a9 (diff)
L2 BVI/FIB: Update L2 FIB table when BVI's MAC changes
also some moving of l2 headers to reduce dependencies Change-Id: I7a700a411a91451ef13fd65f9c90de2432b793bb Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/l2/l2_input.c')
-rw-r--r--src/vnet/l2/l2_input.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/vnet/l2/l2_input.c b/src/vnet/l2/l2_input.c
index fd6f9eb462c..7e41c886dec 100644
--- a/src/vnet/l2/l2_input.c
+++ b/src/vnet/l2/l2_input.c
@@ -539,6 +539,27 @@ l2input_set_bridge_features (u32 bd_index, u32 feat_mask, u32 feat_value)
return bd_config->feature_bitmap;
}
+void
+l2input_interface_mac_change (u32 sw_if_index,
+ const u8 * old_address, const u8 * new_address)
+{
+ /* check if the sw_if_index passed is a BVI in a BD */
+ l2_input_config_t *intf_config;
+
+ intf_config = l2input_intf_config (sw_if_index);
+
+ if (intf_config->bridge && intf_config->bvi)
+ {
+ /* delete and re-add l2fib entry for the bvi interface */
+ l2fib_del_entry (old_address, intf_config->bd_index, sw_if_index);
+ l2fib_add_entry (new_address,
+ intf_config->bd_index,
+ sw_if_index,
+ L2FIB_ENTRY_RESULT_FLAG_BVI |
+ L2FIB_ENTRY_RESULT_FLAG_STATIC);
+ }
+}
+
/**
* Set the subinterface to run in l2 or l3 mode.
* For L3 mode, just the sw_if_index is specified.