X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fdevices%2Ftap%2Ftapv2_api.c;h=c6da0c9deae05a720a93173340ae3685fc62dc70;hb=9e6356962a0cbb84f7ea9056b954d65aaa231a61;hp=9f46884ca8cf340738f0b8797d81c4c3529d681c;hpb=6c4dae27e75fc668f86c9cca0f3f58273b680621;p=vpp.git diff --git a/src/vnet/devices/tap/tapv2_api.c b/src/vnet/devices/tap/tapv2_api.c index 9f46884ca8c..c6da0c9deae 100644 --- a/src/vnet/devices/tap/tapv2_api.c +++ b/src/vnet/devices/tap/tapv2_api.c @@ -59,7 +59,7 @@ vl_api_tap_create_v2_t_handler (vl_api_tap_create_v2_t * mp) memset (ap, 0, sizeof (*ap)); - ap->id = mp->id; + ap->id = ntohl (mp->id); if (!mp->use_random_mac) { clib_memcpy (ap->mac_addr, mp->mac_address, 6); @@ -96,6 +96,18 @@ vl_api_tap_create_v2_t_handler (vl_api_tap_create_v2_t * mp) ap->host_ip6_prefix_len = mp->host_ip6_prefix_len; } + if (mp->host_ip4_gw_set) + { + clib_memcpy (&ap->host_ip4_gw, mp->host_ip4_gw, 4); + ap->host_ip4_gw_set = 1; + } + + if (mp->host_ip6_gw_set) + { + clib_memcpy (&ap->host_ip6_gw, mp->host_ip6_gw, 16); + ap->host_ip6_gw_set = 1; + } + tap_create_if (vm, ap); reg = vl_api_client_index_to_registration (mp->client_index);