X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fdevices%2Ftap%2Ftap.c;h=e6a7ba518a665313bee7566609bd5e909421fa6b;hb=7866c4595b65f54f491ffc4e92b1f8cf94d6f142;hp=a7d10fe547310cc013b7e47f4b7338107e6598db;hpb=929fb9d75071ef4141b1cac3997f86d9ded0a9ab;p=vpp.git diff --git a/src/vnet/devices/tap/tap.c b/src/vnet/devices/tap/tap.c index a7d10fe5473..e6a7ba518a6 100644 --- a/src/vnet/devices/tap/tap.c +++ b/src/vnet/devices/tap/tap.c @@ -292,6 +292,26 @@ tap_create_if (vlib_main_t * vm, tap_create_if_args_t * args) goto error; } + if (args->host_ip4_gw_set) + { + args->error = vnet_netlink_add_ip4_route (0, 0, &args->host_ip4_gw); + if (args->error) + { + args->rv = VNET_API_ERROR_NETLINK_ERROR; + goto error; + } + } + + if (args->host_ip6_gw_set) + { + args->error = vnet_netlink_add_ip6_route (0, 0, &args->host_ip6_gw); + if (args->error) + { + args->rv = VNET_API_ERROR_NETLINK_ERROR; + goto error; + } + } + /* switch back to old net namespace */ if (args->host_namespace) {