aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/interface_cli.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/interface_cli.c')
-rw-r--r--src/vnet/interface_cli.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/vnet/interface_cli.c b/src/vnet/interface_cli.c
index 9de674a10fa..1c0d8f5db76 100644
--- a/src/vnet/interface_cli.c
+++ b/src/vnet/interface_cli.c
@@ -781,9 +781,6 @@ create_sub_interfaces (vlib_main_t * vm,
continue;
}
- kp = clib_mem_alloc (sizeof (*kp));
- *kp = sup_and_sub_key;
-
template.type = VNET_SW_INTERFACE_TYPE_SUB;
template.flood_class = VNET_FLOOD_CLASS_NORMAL;
template.sup_sw_if_index = hi->sw_if_index;
@@ -795,6 +792,9 @@ create_sub_interfaces (vlib_main_t * vm,
if (error)
goto done;
+ kp = clib_mem_alloc (sizeof (*kp));
+ *kp = sup_and_sub_key;
+
hash_set (hi->sub_interface_sw_if_index_by_id, id, sw_if_index);
hash_set_mem (im->sw_if_index_by_sup_and_sub, kp, sw_if_index);
vlib_cli_output (vm, "%U\n", format_vnet_sw_if_index_name,