summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonald Sharp <donaldsharp72@gmail.com>2024-05-28 19:06:43 +0200
committerGitHub <noreply@github.com>2024-05-28 19:06:43 +0200
commitcccb0cd80557c5d804c2418201ca378ff0d6269d (patch)
tree1cd45373e4cf040d6910edff902527a7c20610a4
parentMerge pull request #15993 from zhou-run/202405091114 (diff)
parentdoc: adjust one ospf command (diff)
downloadfrr-cccb0cd80557c5d804c2418201ca378ff0d6269d.tar.xz
frr-cccb0cd80557c5d804c2418201ca378ff0d6269d.zip
Merge pull request #16075 from anlancs/ospfd/fix-cmd-instance
ospfd: add instance id for one command
-rw-r--r--doc/user/ospfd.rst2
-rw-r--r--ospfd/ospf_vty.c15
2 files changed, 15 insertions, 2 deletions
diff --git a/doc/user/ospfd.rst b/doc/user/ospfd.rst
index ad0b25aec..70c15e73d 100644
--- a/doc/user/ospfd.rst
+++ b/doc/user/ospfd.rst
@@ -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.
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c
index 301320bb0..7cb51976f 100644
--- a/ospfd/ospf_vty.c
+++ b/ospfd/ospf_vty.c
@@ -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"
@@ -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;