Skip to content

Commit

Permalink
isisd: The command 'fast-reroute lfa tiebreaker [downstream|lowest-ba…
Browse files Browse the repository at this point in the history
…ckup-metric|node-protecting] ... has en error'

The command fast-reroute lfa tiebreaker [downstream | lowest-backup-metric | node-protecting] index (1-255) [level-1 | level-2] will overwrite configurations with the same index but different types. This is because the index is set as the key in frr-isisd.yang. However, the lfa_tiebreaker_cmp function uses a tuple (index, type) as the key. Therefore, the yang file should be modified to stay in sync with the business logic.

Test Scenario:
On RouterA, first configure fast-reroute lfa tiebreaker downstream index 100 level-1, then configure fast-reroute lfa tiebreaker lowest-backup-metric index 100 level-1, and check the configuration:

!
router isis 10
 fast-reroute lfa tiebreaker lowest-backup-metric index 100 level-1
exit
!

Signed-off-by: baozhen-H3C <[email protected]>
  • Loading branch information
baozhen-H3C committed Aug 23, 2024
1 parent 93032f1 commit 25eb516
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions isisd/isis_cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -2350,29 +2350,29 @@ DEFPY_YANG (isis_frr_lfa_tiebreaker,
if (no) {
snprintf(
xpath, XPATH_MAXLEN,
"./fast-reroute/level-1/lfa/tiebreaker[index='%s']",
index_str);
"./fast-reroute/level-1/lfa/tiebreaker[index='%s'][type='%s']",
index_str, type);
nb_cli_enqueue_change(vty, xpath, NB_OP_DESTROY, NULL);
} else {
snprintf(
xpath, XPATH_MAXLEN,
"./fast-reroute/level-1/lfa/tiebreaker[index='%s']/type",
index_str);
"./fast-reroute/level-1/lfa/tiebreaker[index='%s'][type='%s']/type",
index_str, type);
nb_cli_enqueue_change(vty, xpath, NB_OP_CREATE, type);
}
}
if (!level || strmatch(level, "level-2")) {
if (no) {
snprintf(
xpath, XPATH_MAXLEN,
"./fast-reroute/level-2/lfa/tiebreaker[index='%s']",
index_str);
"./fast-reroute/level-2/lfa/tiebreaker[index='%s'][type='%s']",
index_str, type);
nb_cli_enqueue_change(vty, xpath, NB_OP_DESTROY, NULL);
} else {
snprintf(
xpath, XPATH_MAXLEN,
"./fast-reroute/level-2/lfa/tiebreaker[index='%s']/type",
index_str);
"./fast-reroute/level-2/lfa/tiebreaker[index='%s'][type='%s']/type",
index_str, type);
nb_cli_enqueue_change(vty, xpath, NB_OP_CREATE, type);
}
}
Expand Down
2 changes: 1 addition & 1 deletion yang/frr-isisd.yang
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ module frr-isisd {
"Limit backup computation up to the prefix priority.";
}
list tiebreaker {
key "index";
key "index type";
unique "type";
description
"Configure tiebreaker for multiple backups.";
Expand Down

0 comments on commit 25eb516

Please sign in to comment.