Skip to content

Commit

Permalink
isisd: fix srv6 exit statements
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
jvoss committed Dec 25, 2024
1 parent 9ce3b14 commit dcb03c4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
16 changes: 10 additions & 6 deletions isisd/isis_cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -2118,6 +2112,11 @@ 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
*/
Expand Down Expand Up @@ -2248,6 +2247,11 @@ 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
*/
Expand Down
8 changes: 7 additions & 1 deletion isisd/isis_nb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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,
},
},
{
Expand Down Expand Up @@ -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,
},
},
{
Expand Down
4 changes: 2 additions & 2 deletions isisd/isis_nb.h
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ 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,
Expand All @@ -332,8 +333,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(
Expand All @@ -344,6 +343,7 @@ 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,
Expand Down

0 comments on commit dcb03c4

Please sign in to comment.