summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--vpp-api-test/vat/api_format.c4
-rw-r--r--vpp/vpp-api/api.c7
-rw-r--r--vpp/vpp-api/custom_dump.c4
3 files changed, 8 insertions, 7 deletions
diff --git a/vpp-api-test/vat/api_format.c b/vpp-api-test/vat/api_format.c
index 7369714b0a0..3d90cae7f83 100644
--- a/vpp-api-test/vat/api_format.c
+++ b/vpp-api-test/vat/api_format.c
@@ -11714,7 +11714,7 @@ api_lisp_add_del_locator_set (vat_main_t * vam)
vec_len (locator_set_name));
vec_free (locator_set_name);
- mp->locator_num = vec_len (locators);
+ mp->locator_num = clib_host_to_net_u32 (vec_len (locators));
if (locators)
clib_memcpy (mp->locators, locators,
(sizeof (ls_locator_t) * vec_len (locators)));
@@ -12458,7 +12458,7 @@ api_lisp_add_del_remote_mapping (vat_main_t * vam)
mp->eid_type = eid->type;
lisp_eid_put_vat (mp->eid, eid->addr, eid->type);
- mp->rloc_num = vec_len (rlocs);
+ mp->rloc_num = clib_host_to_net_u32 (vec_len (rlocs));
clib_memcpy (mp->rlocs, rlocs, (sizeof (rloc_t) * vec_len (rlocs)));
vec_free (rlocs);
diff --git a/vpp/vpp-api/api.c b/vpp/vpp-api/api.c
index f4f085166fe..8bf6d306102 100644
--- a/vpp/vpp-api/api.c
+++ b/vpp/vpp-api/api.c
@@ -5126,7 +5126,7 @@ vl_api_lisp_add_del_locator_set_t_handler (vl_api_lisp_add_del_locator_set_t *
vnet_lisp_add_del_locator_set_args_t _a, *a = &_a;
locator_t locator;
ls_locator_t *ls_loc;
- u32 ls_index = ~0;
+ u32 ls_index = ~0, locator_num;
u8 *locator_name = NULL;
int i;
@@ -5137,9 +5137,10 @@ vl_api_lisp_add_del_locator_set_t_handler (vl_api_lisp_add_del_locator_set_t *
a->name = locator_name;
a->is_add = mp->is_add;
a->local = 1;
+ locator_num = clib_net_to_host_u32 (mp->locator_num);
memset (&locator, 0, sizeof (locator));
- for (i = 0; i < mp->locator_num; i++)
+ for (i = 0; i < locator_num; i++)
{
ls_loc = &((ls_locator_t *) mp->locators)[i];
VALIDATE_SW_IF_INDEX (ls_loc);
@@ -5487,7 +5488,7 @@ static void
if (rv)
goto send_reply;
- rlocs = unformat_lisp_locs (mp->rlocs, mp->rloc_num);
+ rlocs = unformat_lisp_locs (mp->rlocs, clib_net_to_host_u32 (mp->rloc_num));
if (0 == rlocs)
goto send_reply;
diff --git a/vpp/vpp-api/custom_dump.c b/vpp/vpp-api/custom_dump.c
index d1098d36d2f..375535f63c5 100644
--- a/vpp/vpp-api/custom_dump.c
+++ b/vpp/vpp-api/custom_dump.c
@@ -2318,7 +2318,7 @@ static void *vl_api_lisp_add_del_remote_mapping_t_print
mp->eid_type, mp->eid, mp->eid_len, mp->seid, mp->seid_len,
mp->is_src_dst);
- rloc_num = mp->rloc_num;
+ rloc_num = clib_net_to_host_u32 (mp->rloc_num);
if (0 == rloc_num)
s = format (s, "action %d", mp->action);
@@ -2470,7 +2470,7 @@ static void *vl_api_lisp_add_del_locator_set_t_print
s = format (s, "locator-set %s ", mp->locator_set_name);
- loc_num = mp->locator_num;
+ loc_num = clib_net_to_host_u32 (mp->locator_num);
locs = (ls_locator_t *) mp->locators;
for (i = 0; i < loc_num; i++)