tap: fix the api for use of vec_len
Type: fix
Fixes: 03b76a20c569b8275beb8783691300a7d66b54a4
Change-Id: Ife788974cb7b2c35f40a017dd195dc2f7ee797b4
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
diff --git a/src/vnet/devices/tap/tapv2_api.c b/src/vnet/devices/tap/tapv2_api.c
index ea61852..ac38128 100644
--- a/src/vnet/devices/tap/tapv2_api.c
+++ b/src/vnet/devices/tap/tapv2_api.c
@@ -83,7 +83,7 @@
ap->num_rx_queues = mp->num_rx_queues;
if (mp->host_if_name_set)
- ap->host_if_name = mp->host_if_name;
+ ap->host_if_name = format (0, "%s%c", mp->host_if_name, 0);
if (mp->host_mac_addr_set)
{
@@ -91,10 +91,10 @@
}
if (mp->host_namespace_set)
- ap->host_namespace = mp->host_namespace;
+ ap->host_namespace = format (0, "%s%c", mp->host_namespace, 0);
if (mp->host_bridge_set)
- ap->host_bridge = mp->host_bridge;
+ ap->host_bridge = format (0, "%s%c", mp->host_bridge, 0);
if (mp->host_ip4_prefix_set)
{
@@ -164,6 +164,11 @@
rmp->sw_if_index = ntohl (ap->sw_if_index);
vl_api_send_msg (reg, (u8 *) rmp);
+
+ vec_free (ap->host_if_name);
+ vec_free (ap->host_namespace);
+ vec_free (ap->host_bridge);
+
}
static void