summaryrefslogtreecommitdiffstats
path: root/vnet/vnet/ip
diff options
context:
space:
mode:
authorPavel Kotucek <pkotucek@cisco.com>2016-09-26 10:40:02 +0200
committerDamjan Marion <dmarion.lists@gmail.com>2016-09-30 19:08:24 +0000
commitc631f2de6dd06b4cbb92bf8398839b882344fd25 (patch)
tree42e5bd96a33deecaaa5589a32e696896805a4d39 /vnet/vnet/ip
parent83486fb3ef0f25f9787f9aa898eafc6562f1540e (diff)
VPP-363: add ability to change mac address of the interface
Added ability to change interface address. Added new CLI and API functions. Change-Id: Ia336bc75ad8c5858c26f39af851485c4c6f19f58 Signed-off-by: Pavel Kotucek <pkotucek@cisco.com>
Diffstat (limited to 'vnet/vnet/ip')
-rw-r--r--vnet/vnet/ip/ip6_neighbor.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/vnet/vnet/ip/ip6_neighbor.c b/vnet/vnet/ip/ip6_neighbor.c
index 11df776e1fc..5d059e9b9cf 100644
--- a/vnet/vnet/ip/ip6_neighbor.c
+++ b/vnet/vnet/ip/ip6_neighbor.c
@@ -3472,3 +3472,23 @@ int vnet_ip6_nd_term (vlib_main_t * vm,
return 0;
}
+
+void
+ethernet_ndp_change_mac (vlib_main_t * vm, u32 sw_if_index)
+{
+ ip6_neighbor_main_t * nm = &ip6_neighbor_main;
+ ip6_neighbor_t * n;
+
+ /* *INDENT-OFF* */
+ pool_foreach (n, nm->neighbor_pool, ({
+ if (n->key.sw_if_index == sw_if_index)
+ {
+ if (ADJ_INDEX_INVALID != n->adj_index)
+ {
+ adj_nbr_update_rewrite(n->adj_index,
+ n->link_layer_address);
+ }
+ }
+ }));
+ /* *INDENT-ON* */
+}