Add sw_if_index of tunnel interface to API reply for ipsec_tunnel_if_add_del
[vpp.git] / src / vnet / interface.c
index 45417b2..41e2186 100644 (file)
@@ -482,6 +482,13 @@ vnet_sw_interface_set_flags_helper (vnet_main_t * vnm, u32 sw_if_index,
          vnet_device_class_t *dev_class =
            vnet_get_device_class (vnm, hi->dev_class_index);
 
+         if ((flags & VNET_SW_INTERFACE_FLAG_ADMIN_UP) &&
+             (si->flags & VNET_SW_INTERFACE_FLAG_ERROR))
+           {
+             error = clib_error_return (0, "Interface in the error state");
+             goto done;
+           }
+
          /* save the si admin up flag */
          old_flags = si->flags;
 
@@ -919,6 +926,8 @@ vnet_delete_hw_interface (vnet_main_t * vnm, u32 hw_if_index)
 
   hash_unset_mem (im->hw_interface_by_name, hw->name);
   vec_free (hw->name);
+  vec_free (hw->input_node_thread_index_by_queue);
+  vec_free (hw->dq_runtime_index_by_queue);
 
   pool_put (im->hw_interfaces, hw);
 }