aboutsummaryrefslogtreecommitdiffstats
path: root/vpp
diff options
context:
space:
mode:
authorFilip Tehlar <ftehlar@cisco.com>2016-08-26 12:44:38 +0200
committerDamjan Marion <dmarion.lists@gmail.com>2016-08-26 12:40:16 +0000
commite3552c45f38d1f101cf512c9046647201d6c121b (patch)
tree6c96a53555819b27d314de1e778d356984903997 /vpp
parent07203afe6fc5f1573135189329e41f125da1f558 (diff)
VPP-356: Fix wrong byte order in LISP API
Change-Id: Ib2284025b8394a87f1d5765713adb7070b450cba Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Diffstat (limited to 'vpp')
-rw-r--r--vpp/vpp-api/api.c7
-rw-r--r--vpp/vpp-api/custom_dump.c4
2 files changed, 6 insertions, 5 deletions
diff --git a/vpp/vpp-api/api.c b/vpp/vpp-api/api.c
index f4f08516..8bf6d306 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 d1098d36..375535f6 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++)