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 <nranns@cisco.com>
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 |
fib_walk_sync (abf_policy_fib_node_type, api, &ctx);
}
+ fib_path_list_unlock (old_pl);
}
return (0);
old_pl_index = mt->mt_path_list;
+ fib_path_list_lock(old_pl_index);
mt->mt_path_list =
fib_path_list_copy_and_path_remove(old_pl_index,
FIB_PATH_LIST_FLAG_SHARED,
if (FIB_NODE_INDEX_INVALID == mt->mt_path_list)
{
/* no paths left */
+ fib_path_list_unlock(old_pl_index);
return (0);
}
else
mt->mt_path_list);
mpls_tunnel_restack(mt);
+ fib_path_list_unlock(old_pl_index);
}
return (fib_path_list_get_n_paths(mt->mt_path_list));