aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/virtio/tapv2_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/devices/virtio/tapv2_api.c')
-rw-r--r--src/vnet/devices/virtio/tapv2_api.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/vnet/devices/virtio/tapv2_api.c b/src/vnet/devices/virtio/tapv2_api.c
index 1c559e6c28e..7a6adca083f 100644
--- a/src/vnet/devices/virtio/tapv2_api.c
+++ b/src/vnet/devices/virtio/tapv2_api.c
@@ -53,7 +53,6 @@ static void
vl_api_tap_create_v2_t_handler (vl_api_tap_create_v2_t * mp)
{
vlib_main_t *vm = vlib_get_main ();
- int rv;
vl_api_tap_create_v2_reply_t *rmp;
unix_shared_memory_queue_t *q;
tap_create_if_args_t _a, *ap = &_a;
@@ -69,10 +68,26 @@ vl_api_tap_create_v2_t_handler (vl_api_tap_create_v2_t * mp)
ap->rx_ring_sz = mp->rx_ring_sz;
ap->tx_ring_sz = mp->tx_ring_sz;
ap->sw_if_index = (u32) ~ 0;
- if (mp->net_ns_set)
- ap->net_ns = mp->net_ns;
- rv = tap_create_if (vm, ap);
+ if (mp->host_namespace_set)
+ ap->host_namespace = mp->host_namespace;
+
+ if (mp->host_bridge_set)
+ ap->host_bridge = mp->host_bridge;
+
+ if (mp->host_ip4_addr_set)
+ {
+ clib_memcpy (&ap->host_ip4_addr.as_u8, mp->host_ip4_addr, 4);
+ ap->host_ip4_prefix_len = mp->host_ip4_prefix_len;
+ }
+
+ if (mp->host_ip6_addr_set)
+ {
+ clib_memcpy (&ap->host_ip6_addr, mp->host_ip6_addr, 16);
+ ap->host_ip6_prefix_len = mp->host_ip6_prefix_len;
+ }
+
+ tap_create_if (vm, ap);
q = vl_api_client_index_to_input_queue (mp->client_index);
if (!q)
@@ -81,7 +96,7 @@ vl_api_tap_create_v2_t_handler (vl_api_tap_create_v2_t * mp)
rmp = vl_msg_api_alloc (sizeof (*rmp));
rmp->_vl_msg_id = ntohs (VL_API_TAP_CREATE_V2_REPLY);
rmp->context = mp->context;
- rmp->retval = ntohl (rv);
+ rmp->retval = ntohl (ap->rv);
rmp->sw_if_index = ntohl (ap->sw_if_index);
vl_msg_api_send_shmem (q, (u8 *) & rmp);