aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-plugin/src/strategy_dpo_ctx.h
diff options
context:
space:
mode:
Diffstat (limited to 'hicn-plugin/src/strategy_dpo_ctx.h')
-rw-r--r--hicn-plugin/src/strategy_dpo_ctx.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/hicn-plugin/src/strategy_dpo_ctx.h b/hicn-plugin/src/strategy_dpo_ctx.h
index fe63a4258..ae642a350 100644
--- a/hicn-plugin/src/strategy_dpo_ctx.h
+++ b/hicn-plugin/src/strategy_dpo_ctx.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2020 Cisco and/or its affiliates.
+ * Copyright (c) 2021 Cisco and/or its affiliates.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
@@ -99,6 +99,7 @@ init_dpo_ctx (hicn_dpo_ctx_t *dpo_ctx, const hicn_face_id_t *next_hop,
int nh_len, dpo_type_t dpo_type, dpo_proto_t proto)
{
hicn_face_id_t invalid = NEXT_HOP_INVALID;
+ int i = 0;
dpo_ctx->entry_count = 0;
dpo_ctx->locks = 0;
@@ -108,15 +109,15 @@ init_dpo_ctx (hicn_dpo_ctx_t *dpo_ctx, const hicn_face_id_t *next_hop,
dpo_ctx->seq = INIT_SEQ;
dpo_ctx->dpo_type = dpo_type;
- dpo_ctx->proto = proto;
+ dpo_ctx->proto = (fib_protocol_t) proto;
- for (int i = 0; i < HICN_PARAM_FIB_ENTRY_NHOPS_MAX && i < nh_len; i++)
+ for (i = 0; i < HICN_PARAM_FIB_ENTRY_NHOPS_MAX && i < nh_len; i++)
{
dpo_ctx->next_hops[i] = next_hop[i];
dpo_ctx->entry_count++;
}
- for (int i = nh_len; i < HICN_PARAM_FIB_ENTRY_NHOPS_MAX; i++)
+ for (; i < HICN_PARAM_FIB_ENTRY_NHOPS_MAX; i++)
{
dpo_ctx->next_hops[i] = invalid;
}