From 5d0136f09944b0d7ea9d1db5c368d4d0b36cedd2 Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Tue, 12 May 2020 08:51:02 +0000 Subject: feature: Config end nodes are user specific Type: fix it is possible for a user to change the end node of a feature arc, but this change should only apply to that 'instnace' of the arc, not all arcs. for example, if a tunnel has its ipx-output end node changed to adj-midchain-tx, this shouldn't affect all ipx-output arcs. obviously... Signed-off-by: Neale Ranns Change-Id: I41daea7ba6907963e42140307d065c8bcfdcb585 --- src/vnet/feature/feature.c | 18 ++++++++++++------ src/vnet/feature/feature.h | 2 +- 2 files changed, 13 insertions(+), 7 deletions(-) (limited to 'src/vnet/feature') diff --git a/src/vnet/feature/feature.c b/src/vnet/feature/feature.c index 4a5127db6ac..09dd9cc965f 100644 --- a/src/vnet/feature/feature.c +++ b/src/vnet/feature/feature.c @@ -321,7 +321,7 @@ vnet_feature_enable_disable (const char *arc_name, const char *node_name, n_feature_config_bytes); } -int +u32 vnet_feature_modify_end_node (u8 arc_index, u32 sw_if_index, u32 end_node_index) { @@ -342,12 +342,10 @@ vnet_feature_modify_end_node (u8 arc_index, ci = vnet_config_modify_end_node (vlib_get_main (), &cm->config_main, ci, end_node_index); - if (ci == ~0) - return 0; - - cm->config_index_by_sw_if_index[sw_if_index] = ci; + if (ci != ~0) + cm->config_index_by_sw_if_index[sw_if_index] = ci; - return 0; + return ci; } static int @@ -495,6 +493,14 @@ vnet_interface_features_show (vlib_main_t * vm, u32 sw_if_index, int verbose) else vlib_cli_output (vm, " %v", n->name); } + if (verbose) + { + n = + vlib_get_node (vm, + vcm->end_node_indices_by_user_index + [current_config_index]); + vlib_cli_output (vm, " [end] %v", n->name); + } } } diff --git a/src/vnet/feature/feature.h b/src/vnet/feature/feature.h index 4d568a512a8..6eb6de3fba7 100644 --- a/src/vnet/feature/feature.h +++ b/src/vnet/feature/feature.h @@ -219,7 +219,7 @@ vnet_feature_enable_disable (const char *arc_name, const char *node_name, void *feature_config, u32 n_feature_config_bytes); -int +u32 vnet_feature_modify_end_node (u8 arc_index, u32 sw_if_index, u32 node_index); static_always_inline u32 -- cgit 1.2.3-korg