X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fdevices%2Fdevices.c;h=a38ecd2d1bbbcb4f57e39b00fc6ecbeead76dec1;hb=5665a22f81dd48c6d211a9a2be83d174c62d73cf;hp=2eb8e30e076755f116006fecb41fd41744f3aea8;hpb=15ac81c16fba83033090299413a3a2dbb848a0f9;p=vpp.git diff --git a/src/vnet/devices/devices.c b/src/vnet/devices/devices.c index 2eb8e30e076..a38ecd2d1bb 100644 --- a/src/vnet/devices/devices.c +++ b/src/vnet/devices/devices.c @@ -264,6 +264,10 @@ vnet_hw_interface_set_rx_mode (vnet_main_t * vnm, u32 hw_if_index, (hw->flags & VNET_HW_INTERFACE_FLAG_SUPPORTS_INT_MODE) == 0) return VNET_API_ERROR_UNSUPPORTED; + if ((vec_len (hw->input_node_thread_index_by_queue) < queue_id + 1) || + (vec_len (hw->rx_mode_by_queue) < queue_id + 1)) + return VNET_API_ERROR_INVALID_QUEUE; + hw->rx_mode_by_queue[queue_id] = mode; thread_index = hw->input_node_thread_index_by_queue[queue_id]; vm = vlib_mains[thread_index]; @@ -307,6 +311,10 @@ vnet_hw_interface_get_rx_mode (vnet_main_t * vnm, u32 hw_if_index, if (hw->input_node_thread_index_by_queue == 0) return VNET_API_ERROR_INVALID_INTERFACE; + if ((vec_len (hw->input_node_thread_index_by_queue) < queue_id + 1) || + (vec_len (hw->rx_mode_by_queue) < queue_id + 1)) + return VNET_API_ERROR_INVALID_QUEUE; + thread_index = hw->input_node_thread_index_by_queue[queue_id]; vm = vlib_mains[thread_index];