Fix LISP L2 fwd entry updates 50/3250/3
authorFlorin Coras <[email protected]>
Tue, 4 Oct 2016 15:03:49 +0000 (18:03 +0300)
committerDamjan Marion <[email protected]>
Tue, 4 Oct 2016 23:06:33 +0000 (23:06 +0000)
Change-Id: I554041bf47aa82dd6f6e0563c68d8bbd3b18b255
Signed-off-by: Florin Coras <[email protected]>
vnet/vnet/lisp-gpe/lisp_gpe_fwd_entry.c

index 80710cd..3bd83dc 100644 (file)
@@ -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);