aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/lisp-cp/control.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/lisp-cp/control.c')
-rw-r--r--src/vnet/lisp-cp/control.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/src/vnet/lisp-cp/control.c b/src/vnet/lisp-cp/control.c
index d2cc8da717b..6f26d1e2aeb 100644
--- a/src/vnet/lisp-cp/control.c
+++ b/src/vnet/lisp-cp/control.c
@@ -1398,19 +1398,19 @@ vnet_lisp_del_mapping (gid_address_t * eid, u32 * res_map_index)
gid_address_copy (&m_args->eid, eid);
m_args->locator_set_index = old_map->locator_set_index;
- /* delete mapping associated from map-cache */
- vnet_lisp_map_cache_add_del (m_args, 0);
-
ls_args->is_add = 0;
ls_args->index = old_map->locator_set_index;
- /* delete locator set */
- vnet_lisp_add_del_locator_set (ls_args, 0);
-
/* delete timer associated to the mapping if any */
if (old_map->timer_set)
mapping_delete_timer (lcm, mi);
+ /* delete locator set */
+ vnet_lisp_add_del_locator_set (ls_args, 0);
+
+ /* delete mapping associated from map-cache */
+ vnet_lisp_map_cache_add_del (m_args, 0);
+
/* return old mapping index */
if (res_map_index)
res_map_index[0] = mi;
@@ -2004,8 +2004,8 @@ vnet_lisp_add_del_locator (vnet_lisp_add_del_locator_set_args_t * a,
removed = 1;
remove_locator_from_locator_set (ls, locit, ls_index, loc_id);
}
- if (0 == loc->local &&
- !gid_address_cmp (&loc->address, &itloc->address))
+ else if (0 == loc->local &&
+ !gid_address_cmp (&loc->address, &itloc->address))
{
removed = 1;
remove_locator_from_locator_set (ls, locit, ls_index, loc_id);
@@ -2083,14 +2083,9 @@ vnet_lisp_add_del_locator_set (vnet_lisp_add_del_locator_set_args_t * a,
ls->name = vec_dup (a->name);
if (!lcm->locator_set_index_by_name)
- lcm->locator_set_index_by_name = hash_create_vec (
- /* size */
- 0,
- sizeof
- (ls->name
- [0]),
- sizeof
- (uword));
+ lcm->locator_set_index_by_name =
+ hash_create_vec ( /* size */ 0, sizeof (ls->name[0]),
+ sizeof (uword));
hash_set_mem (lcm->locator_set_index_by_name, ls->name,
ls_index);