From 13b2ba2ad5527c8185dce368993a3877e7daf7a2 Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Wed, 30 Jan 2019 06:00:19 -0800 Subject: MPLS tunnel; fix crash when deleting non-existant path in the case the tunnel is the only user of the shared path list then removing its dependency removes the path list. hence lock the list Change-Id: I18318441698ceac16715b1826266a7d19dcd76e1 Signed-off-by: Neale Ranns --- src/plugins/abf/abf_policy.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/plugins') diff --git a/src/plugins/abf/abf_policy.c b/src/plugins/abf/abf_policy.c index 1fde97f4c50..c411f3bae62 100644 --- a/src/plugins/abf/abf_policy.c +++ b/src/plugins/abf/abf_policy.c @@ -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); -- cgit 1.2.3-korg