From 2ccf768f13991344abd1306fe529ccc4997c1481 Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Tue, 4 Oct 2016 18:03:49 +0300 Subject: Fix LISP L2 fwd entry updates Change-Id: I554041bf47aa82dd6f6e0563c68d8bbd3b18b255 Signed-off-by: Florin Coras --- vnet/vnet/lisp-gpe/lisp_gpe_fwd_entry.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'vnet') diff --git a/vnet/vnet/lisp-gpe/lisp_gpe_fwd_entry.c b/vnet/vnet/lisp-gpe/lisp_gpe_fwd_entry.c index 80710cdd62d..3bd83dca87c 100644 --- a/vnet/vnet/lisp-gpe/lisp_gpe_fwd_entry.c +++ b/vnet/vnet/lisp-gpe/lisp_gpe_fwd_entry.c @@ -617,17 +617,20 @@ del_l2_fwd_entry_i (lisp_gpe_main_t * lgm, lisp_gpe_fwd_entry_t * lfe) { lisp_fwd_path_t *path; - vec_foreach (path, lfe->paths) - { - lisp_gpe_adjacency_unlock (path->lisp_adj); - } + if (LISP_GPE_FWD_ENTRY_TYPE_NEGATIVE != lfe->type) + { + vec_foreach (path, lfe->paths) + { + lisp_gpe_adjacency_unlock (path->lisp_adj); + } + fib_path_list_child_remove (lfe->l2.path_list_index, + lfe->l2.child_index); + } lisp_l2_fib_add_del_entry (lfe->l2.eid_bd_index, fid_addr_mac (&lfe->key->lcl), fid_addr_mac (&lfe->key->rmt), NULL, 0); - fib_path_list_child_remove (lfe->l2.path_list_index, lfe->l2.child_index); - hash_unset_mem (lgm->lisp_gpe_fwd_entries, lfe->key); clib_mem_free (lfe->key); pool_put (lgm->lisp_fwd_entry_pool, lfe); @@ -652,7 +655,7 @@ del_l2_fwd_entry (lisp_gpe_main_t * lgm, lfe = find_fwd_entry (lgm, a, &key); - if (NULL != lfe) + if (NULL == lfe) return VNET_API_ERROR_INVALID_VALUE; del_l2_fwd_entry_i (lgm, lfe); -- cgit 1.2.3-korg