summaryrefslogtreecommitdiffstats
path: root/src/vnet/interface.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/interface.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/interface.c')
-rw-r--r--src/vnet/interface.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/vnet/interface.c b/src/vnet/interface.c
index 1e69ccbf6ea..e04ba9b10af 100644
--- a/src/vnet/interface.c
+++ b/src/vnet/interface.c
@@ -42,6 +42,7 @@
#include <vnet/fib/ip6_fib.h>
#include <vnet/adj/adj.h>
#include <vnet/adj/adj_mcast.h>
+#include <vnet/l2/l2_input.h>
#define VNET_INTERFACE_SET_FLAGS_HELPER_IS_CREATE (1 << 0)
#define VNET_INTERFACE_SET_FLAGS_HELPER_WANT_REDISTRIBUTE (1 << 1)
@@ -1501,12 +1502,14 @@ vnet_hw_interface_change_mac_address_helper (vnet_main_t * vnm,
if (hi->hw_address)
{
+ u8 *old_address = vec_dup (hi->hw_address);
vnet_device_class_t *dev_class =
vnet_get_device_class (vnm, hi->dev_class_index);
if (dev_class->mac_addr_change_function)
{
error =
- dev_class->mac_addr_change_function (hi, (char *) mac_address);
+ dev_class->mac_addr_change_function (hi, old_address,
+ mac_address);
}
if (!error)
{
@@ -1515,7 +1518,7 @@ vnet_hw_interface_change_mac_address_helper (vnet_main_t * vnm,
hw_class = vnet_get_hw_interface_class (vnm, hi->hw_class_index);
if (NULL != hw_class->mac_addr_change_function)
- hw_class->mac_addr_change_function (hi, (char *) mac_address);
+ hw_class->mac_addr_change_function (hi, old_address, mac_address);
}
else
{
@@ -1523,6 +1526,7 @@ vnet_hw_interface_change_mac_address_helper (vnet_main_t * vnm,
clib_error_return (0,
"MAC Address Change is not supported on this interface");
}
+ vec_free (old_address);
}
else
{