MPLS tunnel; fix crash when deleting non-existant path
[vpp.git] / src / plugins / abf / abf_policy.c
index 1fde97f..c411f3b 100644 (file)
@@ -198,6 +198,7 @@ abf_policy_delete (u32 policy_id, const fib_route_path_t * rpaths)
       ap = abf_policy_get (api);
       old_pl = ap->ap_pl;
 
+      fib_path_list_lock (old_pl);
       ap->ap_pl =
        fib_path_list_copy_and_path_remove (ap->ap_pl,
                                            (FIB_PATH_LIST_FLAG_SHARED |
@@ -227,6 +228,7 @@ abf_policy_delete (u32 policy_id, const fib_route_path_t * rpaths)
 
          fib_walk_sync (abf_policy_fib_node_type, api, &ctx);
        }
+      fib_path_list_unlock (old_pl);
     }
 
   return (0);