Skip to content

Commit

Permalink
Merge pull request FRRouting#16075 from anlancs/ospfd/fix-cmd-instance
Browse files Browse the repository at this point in the history
ospfd: add instance id for one command
  • Loading branch information
donaldsharp authored May 28, 2024
2 parents 447e7be + b212c4d commit cccb0cd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc/user/ospfd.rst
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@ Showing Information
User can get that information as JSON format when ``json`` keyword
at the end of cli is presented.

.. clicmd:: show ip ospf graceful-restart helper [detail] [json]
.. clicmd:: show ip ospf [{(1-65535)|vrf <NAME|all>}] graceful-restart helper [detail] [json]

Displays the Graceful Restart Helper details including helper
config changes.
Expand Down
15 changes: 14 additions & 1 deletion ospfd/ospf_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -10755,10 +10755,11 @@ DEFUN (ospf_route_aggregation_timer,

DEFPY (show_ip_ospf_gr_helper,
show_ip_ospf_gr_helper_cmd,
"show ip ospf [vrf <NAME|all>] graceful-restart helper [detail] [json]",
"show ip ospf [{(1-65535)$instance|vrf <NAME|all>}] graceful-restart helper [detail] [json]",
SHOW_STR
IP_STR
"OSPF information\n"
"Instance ID\n"
VRF_CMD_HELP_STR
"All VRFs\n"
"OSPF Graceful Restart\n"
Expand All @@ -10779,8 +10780,20 @@ DEFPY (show_ip_ospf_gr_helper,
int inst = 0;
bool detail = false;

if (instance && instance != ospf_instance)
return CMD_NOT_MY_INSTANCE;

ospf = ospf_lookup_instance(instance);
if (!ospf || !ospf->oi_running)
return CMD_SUCCESS;

OSPF_FIND_VRF_ARGS(argv, argc, idx_vrf, vrf_name, all_vrf);

if (instance && vrf_name) {
vty_out(vty, "%% VRF is not supported in instance mode\n");
return CMD_WARNING;
}

if (argv_find(argv, argc, "detail", &idx))
detail = true;

Expand Down

0 comments on commit cccb0cd

Please sign in to comment.