summaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/tap/tapv2_api.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2017-12-04 20:03:37 +0100
committerDave Barach <openvpp@barachs.net>2017-12-08 19:33:49 +0000
commit2df39094d20ae60d2e04316f4ec058f81778cf64 (patch)
tree94db0b2286ac490bf412e6de117faa7e0eda2d00 /src/vnet/devices/tap/tapv2_api.c
parent20ec7165007bd38359ea516fe5389e9e828a9d62 (diff)
tapv2: multiple improvements
- change interface naming scheme - rework netlink code - add option to set link address, namespace Change-Id: Icf667babb3077a07617b0b87c45c957e345cb4d1 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vnet/devices/tap/tapv2_api.c')
-rw-r--r--src/vnet/devices/tap/tapv2_api.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/vnet/devices/tap/tapv2_api.c b/src/vnet/devices/tap/tapv2_api.c
index 2b324d6b545..3cededbfe82 100644
--- a/src/vnet/devices/tap/tapv2_api.c
+++ b/src/vnet/devices/tap/tapv2_api.c
@@ -59,16 +59,25 @@ vl_api_tap_create_v2_t_handler (vl_api_tap_create_v2_t * mp)
memset (ap, 0, sizeof (*ap));
- ap->name = mp->tap_name;
+ ap->id = mp->id;
if (!mp->use_random_mac)
{
- clib_memcpy (ap->hw_addr, mp->mac_address, 6);
- ap->hw_addr_set = 1;
+ clib_memcpy (ap->mac_addr, mp->mac_address, 6);
+ ap->mac_addr_set = 1;
}
ap->rx_ring_sz = ntohs (mp->rx_ring_sz);
ap->tx_ring_sz = ntohs (mp->tx_ring_sz);
ap->sw_if_index = (u32) ~ 0;
+ if (mp->host_if_name_set)
+ ap->host_if_name = mp->host_if_name;
+
+ if (mp->host_mac_addr_set)
+ {
+ clib_memcpy (ap->host_mac_addr, mp->host_mac_addr, 6);
+ ap->mac_addr_set = 1;
+ }
+
if (mp->host_namespace_set)
ap->host_namespace = mp->host_namespace;