summaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorJuraj Sloboda <jsloboda@cisco.com>2018-09-28 12:04:26 +0200
committerOle Trøan <otroan@employees.org>2018-10-02 12:19:54 +0000
commit83c46a2c5c97320e029b4dd154a45212530f221d (patch)
tree00ff6ddd49c3b4148882814df715f7b54da23e41 /src/vnet
parent8f39d55a298e08ac808da6988032f14d542627c6 (diff)
vhost_user: Fix setting MTU using uninitialized variable
Change-Id: I0caa5fd584e3785f237d08f3d3be23e9bfee7605 Signed-off-by: Juraj Sloboda <jsloboda@cisco.com>
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/devices/virtio/vhost_user.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/vnet/devices/virtio/vhost_user.c b/src/vnet/devices/virtio/vhost_user.c
index 6259096830a..863cebe0edf 100644
--- a/src/vnet/devices/virtio/vhost_user.c
+++ b/src/vnet/devices/virtio/vhost_user.c
@@ -1359,8 +1359,6 @@ vhost_user_create_ethernet (vnet_main_t * vnm, vlib_main_t * vm,
if (error)
clib_error_report (error);
-
- vnet_sw_interface_set_mtu (vnm, vui->sw_if_index, 9000);
}
/*
@@ -1471,6 +1469,7 @@ vhost_user_create_if (vnet_main_t * vnm, vlib_main_t * vm,
vhost_user_create_ethernet (vnm, vm, vui, hwaddr);
vhost_user_vui_init (vnm, vui, server_sock_fd, sock_filename,
feature_mask, &sw_if_idx);
+ vnet_sw_interface_set_mtu (vnm, vui->sw_if_index, 9000);
if (renumber)
vnet_interface_name_renumber (sw_if_idx, custom_dev_instance);