X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fmpls%2Fmpls_tunnel.c;h=f6e5dabdd8f8f8b74101d6c8be92e5bb01901389;hb=f5fa5ae2b021f946fbb8ec56e692459cd34bc7fb;hp=1d85c3bc78c344acc4260b126dff562f86ac6ea4;hpb=bdc0e6b7204ea0211d4f7881497e4306586fb9ef;p=vpp.git diff --git a/src/vnet/mpls/mpls_tunnel.c b/src/vnet/mpls/mpls_tunnel.c index 1d85c3bc78c..f6e5dabdd8f 100644 --- a/src/vnet/mpls/mpls_tunnel.c +++ b/src/vnet/mpls/mpls_tunnel.c @@ -165,9 +165,12 @@ mpls_tunnel_mk_lb (mpls_tunnel_t *mt, lb_proto = fib_forw_chain_type_to_dpo_proto(fct); - fib_path_list_walk(mt->mt_path_list, - mpls_tunnel_collect_forwarding, - &ctx); + if (FIB_NODE_INDEX_INVALID != mt->mt_path_list) + { + fib_path_list_walk(mt->mt_path_list, + mpls_tunnel_collect_forwarding, + &ctx); + } if (!dpo_id_is_valid(dpo_lb)) { @@ -760,6 +763,18 @@ vnet_mpls_tunnel_path_remove (u32 sw_if_index, return (fib_path_list_get_n_paths(mt->mt_path_list)); } +int +vnet_mpls_tunnel_get_index (u32 sw_if_index) +{ + mpls_tunnel_t *mt; + + mt = mpls_tunnel_get_from_sw_if_index(sw_if_index); + + if (NULL == mt) + return (~0); + + return (mt - mpls_tunnel_pool); +} static clib_error_t * vnet_create_mpls_tunnel_command_fn (vlib_main_t * vm,