aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/vnet/devices/tap/tap.c25
1 files changed, 8 insertions, 17 deletions
diff --git a/src/vnet/devices/tap/tap.c b/src/vnet/devices/tap/tap.c
index 33d6e3bc84a..8fca35df202 100644
--- a/src/vnet/devices/tap/tap.c
+++ b/src/vnet/devices/tap/tap.c
@@ -195,13 +195,7 @@ tap_create_if (vlib_main_t * vm, tap_create_if_args_t * args)
if (args->tap_flags & TAP_FLAG_ATTACH)
{
- if (args->host_if_name != NULL)
- {
- host_if_name = (char *) args->host_if_name;
- clib_memcpy (ifr.ifr_name, host_if_name,
- clib_min (IFNAMSIZ, vec_len (host_if_name)));
- }
- else
+ if (args->host_if_name == NULL)
{
args->rv = VNET_API_ERROR_NO_MATCHING_INTERFACE;
err = clib_error_return (0, "host_if_name is not provided");
@@ -227,6 +221,13 @@ tap_create_if (vlib_main_t * vm, tap_create_if_args_t * args)
}
}
+ if (args->host_if_name != NULL)
+ {
+ host_if_name = (char *) args->host_if_name;
+ clib_memcpy (ifr.ifr_name, host_if_name,
+ clib_min (IFNAMSIZ, vec_len (host_if_name)));
+ }
+
if ((tfd = open ("/dev/net/tun", O_RDWR | O_NONBLOCK)) < 0)
{
args->rv = VNET_API_ERROR_SYSCALL_ERROR_2;
@@ -435,16 +436,6 @@ tap_create_if (vlib_main_t * vm, tap_create_if_args_t * args)
goto error;
}
}
- else if (host_if_name)
- {
- args->error =
- vnet_netlink_set_link_name (vif->ifindex, host_if_name);
- if (args->error)
- {
- args->rv = VNET_API_ERROR_NETLINK_ERROR;
- goto error;
- }
- }
}
if (vif->type == VIRTIO_IF_TYPE_TAP)