summaryrefslogtreecommitdiffstats
path: root/src/vnet/lisp-cp/lisp_api.c
diff options
context:
space:
mode:
authorFilip Tehlar <ftehlar@cisco.com>2017-10-26 23:57:09 -0700
committerFlorin Coras <florin.coras@gmail.com>2017-10-30 14:36:50 +0000
commit9d286a47017c3cb641e62586929ec4dbac04a2d4 (patch)
treeaa6f22e0cfdee08302cfd1e5662498944a463cec /src/vnet/lisp-cp/lisp_api.c
parent7008da2667d2876bc58aa5ae57c4a9de48cc756b (diff)
LISP: improve updating the dataplne when locators change
Change-Id: Ifc0296834e25ddbdd0ad8283c061f309801b053c Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Diffstat (limited to 'src/vnet/lisp-cp/lisp_api.c')
-rw-r--r--src/vnet/lisp-cp/lisp_api.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/vnet/lisp-cp/lisp_api.c b/src/vnet/lisp-cp/lisp_api.c
index cb2eb0d9171..58235d046c8 100644
--- a/src/vnet/lisp-cp/lisp_api.c
+++ b/src/vnet/lisp-cp/lisp_api.c
@@ -128,7 +128,7 @@ vl_api_lisp_add_del_locator_set_t_handler (vl_api_lisp_add_del_locator_set_t *
memset (a, 0, sizeof (a[0]));
- mp->locator_set_name[63] = 0;
+ mp->locator_set_name[sizeof (mp->locator_set_name) - 1] = 0;
locator_name = format (0, "%s", mp->locator_set_name);
vec_terminate_c_string (locator_name);
@@ -184,7 +184,7 @@ vl_api_lisp_add_del_locator_t_handler (vl_api_lisp_add_del_locator_t * mp)
locator.local = 1;
vec_add1 (locators, locator);
- mp->locator_set_name[63] = 0;
+ mp->locator_set_name[sizeof (mp->locator_set_name) - 1] = 0;
locator_name = format (0, "%s", mp->locator_set_name);
vec_terminate_c_string (locator_name);
@@ -252,7 +252,7 @@ vl_api_lisp_add_del_local_eid_t_handler (vl_api_lisp_add_del_local_eid_t * mp)
if (rv)
goto out;
- mp->locator_set_name[63] = 0;
+ mp->locator_set_name[sizeof (mp->locator_set_name) - 1] = 0;
name = format (0, "%s", mp->locator_set_name);
vec_terminate_c_string (name);
p = hash_get_mem (lcm->locator_set_index_by_name, name);
@@ -395,6 +395,7 @@ vl_api_lisp_pitr_set_locator_set_t_handler (vl_api_lisp_pitr_set_locator_set_t
int rv = 0;
u8 *ls_name = 0;
+ mp->ls_name[sizeof (mp->ls_name) - 1] = 0;
ls_name = format (0, "%s", mp->ls_name);
vec_terminate_c_string (ls_name);
rv = vnet_lisp_pitr_set_locator_set (ls_name, mp->is_add);
@@ -483,7 +484,7 @@ static void
u8 *locator_set_name = NULL;
vnet_lisp_add_del_mreq_itr_rloc_args_t _a, *a = &_a;
- mp->locator_set_name[63] = 0;
+ mp->locator_set_name[sizeof (mp->locator_set_name) - 1] = 0;
locator_set_name = format (0, "%s", mp->locator_set_name);
vec_terminate_c_string (locator_set_name);