aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/vnet/crypto/cli.c2
-rw-r--r--src/vnet/crypto/crypto.c2
-rw-r--r--src/vnet/crypto/crypto.h3
3 files changed, 4 insertions, 3 deletions
diff --git a/src/vnet/crypto/cli.c b/src/vnet/crypto/cli.c
index 4b0e093b02e..8d523aec484 100644
--- a/src/vnet/crypto/cli.c
+++ b/src/vnet/crypto/cli.c
@@ -71,7 +71,7 @@ format_vnet_crypto_handlers (u8 * s, va_list * args)
if (id == 0)
continue;
- od = vec_elt_at_index (cm->opt_data, id);
+ od = cm->opt_data + id;
if (first == 0)
s = format (s, "\n%U", format_white_space, indent);
s = format (s, "%-20U%-20U", format_vnet_crypto_op_type, od->type,
diff --git a/src/vnet/crypto/crypto.c b/src/vnet/crypto/crypto.c
index 4da8a14a14b..c465f14b7f9 100644
--- a/src/vnet/crypto/crypto.c
+++ b/src/vnet/crypto/crypto.c
@@ -118,7 +118,7 @@ vnet_crypto_set_handler (char *alg_name, char *engine)
vnet_crypto_op_id_t id = ad->op_by_type[i];
if (id == 0)
continue;
- od = vec_elt_at_index (cm->opt_data, id);
+ od = cm->opt_data + id;
if (ce->ops_handlers[id])
{
od->active_engine_index = p[0];
diff --git a/src/vnet/crypto/crypto.h b/src/vnet/crypto/crypto.h
index 9326a078f8a..626e71d5030 100644
--- a/src/vnet/crypto/crypto.h
+++ b/src/vnet/crypto/crypto.h
@@ -231,7 +231,8 @@ static_always_inline vnet_crypto_op_type_t
vnet_crypto_get_op_type (vnet_crypto_op_id_t id)
{
vnet_crypto_main_t *cm = &crypto_main;
- vnet_crypto_op_data_t *od = vec_elt_at_index (cm->opt_data, id);
+ ASSERT (id < VNET_CRYPTO_N_OP_IDS);
+ vnet_crypto_op_data_t *od = cm->opt_data + id;
return od->type;
}