aboutsummaryrefslogtreecommitdiffstats
path: root/src/vat/api_format.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vat/api_format.c')
-rw-r--r--src/vat/api_format.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/src/vat/api_format.c b/src/vat/api_format.c
index 8b8d0c9fdc0..8b56f7693eb 100644
--- a/src/vat/api_format.c
+++ b/src/vat/api_format.c
@@ -7826,16 +7826,17 @@ api_bridge_flags (vat_main_t * vam)
static int
api_bd_ip_mac_add_del (vat_main_t * vam)
{
+ vl_api_address_t ip = VL_API_ZERO_ADDRESS;
+ vl_api_mac_address_t mac = VL_API_ZERO_MAC_ADDRESS;
unformat_input_t *i = vam->input;
vl_api_bd_ip_mac_add_del_t *mp;
+ ip46_type_t type;
u32 bd_id;
u8 is_ipv6 = 0;
u8 is_add = 1;
u8 bd_id_set = 0;
u8 ip_set = 0;
u8 mac_set = 0;
- ip4_address_t v4addr;
- ip6_address_t v6addr;
u8 macaddr[6];
int ret;
@@ -7847,16 +7848,11 @@ api_bd_ip_mac_add_del (vat_main_t * vam)
{
bd_id_set++;
}
- else if (unformat (i, "%U", unformat_ip4_address, &v4addr))
+ else if (unformat (i, "%U", unformat_vl_api_address, &ip))
{
ip_set++;
}
- else if (unformat (i, "%U", unformat_ip6_address, &v6addr))
- {
- ip_set++;
- is_ipv6++;
- }
- else if (unformat (i, "%U", unformat_ethernet_address, macaddr))
+ else if (unformat (i, "%U", unformat_vl_api_mac_address, &mac))
{
mac_set++;
}
@@ -7885,13 +7881,11 @@ api_bd_ip_mac_add_del (vat_main_t * vam)
M (BD_IP_MAC_ADD_DEL, mp);
mp->bd_id = ntohl (bd_id);
- mp->is_ipv6 = is_ipv6;
mp->is_add = is_add;
- if (is_ipv6)
- clib_memcpy (mp->ip_address, &v6addr, sizeof (v6addr));
- else
- clib_memcpy (mp->ip_address, &v4addr, sizeof (v4addr));
- clib_memcpy (mp->mac_address, macaddr, 6);
+
+ clib_memcpy (&mp->ip, &ip, sizeof (ip));
+ clib_memcpy (&mp->mac, &mac, sizeof (mac));
+
S (mp);
W (ret);
return ret;