From e42080e91f568cce2d5783802395cf76575f43ff Mon Sep 17 00:00:00 2001 From: Jonathan Voss Date: Tue, 24 Dec 2024 23:26:37 +0000 Subject: [PATCH] isisd: fix srv6 exit statements Fix missing and misplaced `exit` statements to `show running-config` output. Before: ``` router isis ISIS_CORE [...] segment-routing srv6 locator ISIS_LOC exit <<<<<<< always placed after locator node-msd [...] exit <<<<<<< missng interface dum6 exit ``` After: ``` router isis ISIS_CORE [...] segment-routing srv6 locator ISIS_LOC node-msd [...] exit interface dum6 exit exit ``` Related #16694 Signed-off-by: Jonathan Voss --- isisd/isis_cli.c | 18 ++++++++++++------ isisd/isis_nb.c | 8 +++++++- isisd/isis_nb.h | 6 ++++-- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/isisd/isis_cli.c b/isisd/isis_cli.c index 93f7bbf753a2..31517781c41e 100644 --- a/isisd/isis_cli.c +++ b/isisd/isis_cli.c @@ -2065,12 +2065,6 @@ void cli_show_isis_srv6_locator(struct vty *vty, const struct lyd_node *dnode, vty_out(vty, " locator %s\n", yang_dnode_get_string(dnode, NULL)); } -void cli_show_isis_srv6_locator_end(struct vty *vty, - const struct lyd_node *dnode) -{ - vty_out(vty, " exit\n"); -} - /* * XPath: /frr-isisd:isis/instance/segment-routing-srv6/enabled */ @@ -2118,6 +2112,12 @@ void cli_show_isis_srv6_enabled(struct vty *vty, const struct lyd_node *dnode, vty_out(vty, " segment-routing srv6\n"); } +void cli_show_isis_srv6_end(struct vty *vty, + const struct lyd_node *dnode) +{ + vty_out(vty, " exit\n"); +} + /* * XPath: /frr-isisd:isis/instance/segment-routing-srv6/msd/node-msd */ @@ -2248,6 +2248,12 @@ void cli_show_isis_srv6_node_msd(struct vty *vty, const struct lyd_node *dnode, yang_dnode_get_uint8(dnode, "max-end-d")); } +void cli_show_isis_srv6_node_msd_end(struct vty *vty, + const struct lyd_node *dnode) +{ + vty_out(vty, " exit\n"); +} + /* * XPath: /frr-isisd:isis/instance/segment-routing-srv6/interface */ diff --git a/isisd/isis_nb.c b/isisd/isis_nb.c index 8608d2b9bdf8..3024bb57ead7 100644 --- a/isisd/isis_nb.c +++ b/isisd/isis_nb.c @@ -860,6 +860,12 @@ const struct frr_yang_module_info frr_isisd_info = { .destroy = isis_instance_flex_algo_priority_destroy, }, }, + { + .xpath = "/frr-isisd:isis/instance/segment-routing-srv6", + .cbs = { + .cli_show_end = cli_show_isis_srv6_end, + }, + }, { .xpath = "/frr-isisd:isis/instance/segment-routing-srv6/enabled", .cbs = { @@ -873,7 +879,6 @@ const struct frr_yang_module_info frr_isisd_info = { .modify = isis_instance_segment_routing_srv6_locator_modify, .destroy = isis_instance_segment_routing_srv6_locator_destroy, .cli_show = cli_show_isis_srv6_locator, - .cli_show_end = cli_show_isis_srv6_locator_end, }, }, { @@ -904,6 +909,7 @@ const struct frr_yang_module_info frr_isisd_info = { .xpath = "/frr-isisd:isis/instance/segment-routing-srv6/msd/node-msd", .cbs = { .cli_show = cli_show_isis_srv6_node_msd, + .cli_show_end = cli_show_isis_srv6_node_msd_end, }, }, { diff --git a/isisd/isis_nb.h b/isisd/isis_nb.h index 1bf95e3db365..3c2d7930e69d 100644 --- a/isisd/isis_nb.h +++ b/isisd/isis_nb.h @@ -322,6 +322,8 @@ int isis_instance_flex_algo_affinity_mapping_value_modify( struct nb_cb_modify_args *args); int isis_instance_flex_algo_affinity_mapping_value_destroy( struct nb_cb_destroy_args *args); +void cli_show_isis_srv6_end(struct vty *vty, + const struct lyd_node *dnode); int isis_instance_segment_routing_srv6_enabled_modify( struct nb_cb_modify_args *args); void cli_show_isis_srv6_enabled(struct vty *vty, const struct lyd_node *dnode, @@ -332,8 +334,6 @@ int isis_instance_segment_routing_srv6_locator_destroy( struct nb_cb_destroy_args *args); void cli_show_isis_srv6_locator(struct vty *vty, const struct lyd_node *dnode, bool show_defaults); -void cli_show_isis_srv6_locator_end(struct vty *vty, - const struct lyd_node *dnode); int isis_instance_segment_routing_srv6_msd_node_msd_max_segs_left_modify( struct nb_cb_modify_args *args); int isis_instance_segment_routing_srv6_msd_node_msd_max_end_pop_modify( @@ -344,6 +344,8 @@ int isis_instance_segment_routing_srv6_msd_node_msd_max_end_d_modify( struct nb_cb_modify_args *args); void cli_show_isis_srv6_node_msd(struct vty *vty, const struct lyd_node *dnode, bool show_defaults); +void cli_show_isis_srv6_node_msd_end(struct vty *vty, + const struct lyd_node *dnode); int isis_instance_segment_routing_srv6_interface_modify( struct nb_cb_modify_args *args); void cli_show_isis_srv6_interface(struct vty *vty, const struct lyd_node *dnode,