Skip to content

Commit

Permalink
isisd: fix 'show isis route' and 'show isis fast-reroute summary' err…
Browse files Browse the repository at this point in the history
…ors with vrf

Move 'ISIS_FIND_VRF_ARGS(argv, argc, idx, vrf_name, all_vrf);' to the front, otherwise changing 'idx' while searching for other parameters may result in failing to find the vrf parameter.

Signed-off-by: baozhen-H3C <[email protected]>
  • Loading branch information
baozhen-H3C authored Oct 21, 2024
1 parent 2f84a26 commit 57c0fe2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions isisd/isis_spf.c
Original file line number Diff line number Diff line change
Expand Up @@ -3258,6 +3258,7 @@ DEFUN(show_isis_route, show_isis_route_cmd,
json_object *json = NULL, *json_vrf = NULL;
uint8_t algorithm = SR_ALGORITHM_SPF;

ISIS_FIND_VRF_ARGS(argv, argc, idx, vrf_name, all_vrf);
if (argv_find(argv, argc, "level-1", &idx))
levels = ISIS_LEVEL1;
else if (argv_find(argv, argc, "level-2", &idx))
Expand All @@ -3269,7 +3270,6 @@ DEFUN(show_isis_route, show_isis_route_cmd,
vty_out(vty, "IS-IS Routing Process not enabled\n");
return CMD_SUCCESS;
}
ISIS_FIND_VRF_ARGS(argv, argc, idx, vrf_name, all_vrf);

if (argv_find(argv, argc, "prefix-sid", &idx))
prefix_sid = true;
Expand Down Expand Up @@ -3520,6 +3520,7 @@ DEFUN(show_isis_frr_summary, show_isis_frr_summary_cmd,
bool all_vrf = false;
int idx = 0;

ISIS_FIND_VRF_ARGS(argv, argc, idx, vrf_name, all_vrf);
if (argv_find(argv, argc, "level-1", &idx))
levels = ISIS_LEVEL1;
else if (argv_find(argv, argc, "level-2", &idx))
Expand All @@ -3531,7 +3532,6 @@ DEFUN(show_isis_frr_summary, show_isis_frr_summary_cmd,
vty_out(vty, "IS-IS Routing Process not enabled\n");
return CMD_SUCCESS;
}
ISIS_FIND_VRF_ARGS(argv, argc, idx, vrf_name, all_vrf);

if (all_vrf) {
for (ALL_LIST_ELEMENTS_RO(im->isis, node, isis))
Expand Down

0 comments on commit 57c0fe2

Please sign in to comment.