diff options
author | Neale Ranns <nranns@cisco.com> | 2018-10-24 02:57:49 -0700 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2018-11-06 21:23:18 +0000 |
commit | 4d5b917b1a74461abaa30182d4bf5c7761572323 (patch) | |
tree | a92e08d4de07934dcb49c63661e0ddd74ad0c5a6 /src/vnet/l2/l2_api.c | |
parent | 65ed2d0503bc8d9a6a66ca1ece87e3e876ff95cc (diff) |
BD ARP entry use common API types
Change-Id: I29f20dbaf2c2d735faff297cee552ed648f6f61b
Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/l2/l2_api.c')
-rw-r--r-- | src/vnet/l2/l2_api.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/vnet/l2/l2_api.c b/src/vnet/l2/l2_api.c index 377880c3e64..2fa238eadb3 100644 --- a/src/vnet/l2/l2_api.c +++ b/src/vnet/l2/l2_api.c @@ -27,6 +27,8 @@ #include <vnet/l2/l2_vtr.h> #include <vnet/l2/l2_learn.h> #include <vnet/l2/l2_bd.h> +#include <vnet/ip/ip_types_api.h> +#include <vnet/ethernet/ethernet_types_api.h> #include <vnet/vnet_msg_enum.h> @@ -855,13 +857,17 @@ vl_api_bd_ip_mac_dump_t_handler (vl_api_bd_ip_mac_dump_t * mp) static void vl_api_bd_ip_mac_add_del_t_handler (vl_api_bd_ip_mac_add_del_t * mp) { - bd_main_t *bdm = &bd_main; + ip46_address_t ip_addr = ip46_address_initializer; vl_api_bd_ip_mac_add_del_reply_t *rmp; + bd_main_t *bdm = &bd_main; + u32 bd_index, bd_id; + mac_address_t mac; + ip46_type_t type; int rv = 0; - u32 bd_id = ntohl (mp->bd_id); - u32 bd_index; uword *p; + bd_id = ntohl (mp->bd_id); + if (bd_id == 0) { rv = VNET_API_ERROR_BD_NOT_MODIFIABLE; @@ -874,10 +880,12 @@ vl_api_bd_ip_mac_add_del_t_handler (vl_api_bd_ip_mac_add_del_t * mp) rv = VNET_API_ERROR_NO_SUCH_ENTRY; goto out; } - bd_index = p[0]; - if (bd_add_del_ip_mac (bd_index, mp->ip_address, - mp->mac_address, mp->is_ipv6, mp->is_add)) + + type = ip_address_decode (&mp->ip, &ip_addr); + mac_address_decode (&mp->mac, &mac); + + if (bd_add_del_ip_mac (bd_index, type, &ip_addr, &mac, mp->is_add)) rv = VNET_API_ERROR_UNSPECIFIED; out: |