X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fdevices%2Fvirtio%2Ftapv2_api.c;h=7a6adca083f22e9d9e9894a127b0720c0b6b2fe5;hb=91c6ef7cae2d20ca17a69003a44090614412c63f;hp=1c559e6c28e267ee8d3dcedd664c86d255d1c9a5;hpb=9fa1581cc40b656b6e00d77479fc2424cd50a126;p=vpp.git 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);