forked from Mirror/frr
isisd: 'tiebreaker' command line funtionality is inconsistent with its implementation
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 <bao.zhen@h3c.com>
This commit is contained in:
parent
817c2c9823
commit
27413dd24a
|
@ -2365,31 +2365,27 @@ DEFPY_YANG (isis_frr_lfa_tiebreaker,
|
||||||
|
|
||||||
if (!level || strmatch(level, "level-1")) {
|
if (!level || strmatch(level, "level-1")) {
|
||||||
if (no) {
|
if (no) {
|
||||||
snprintf(
|
snprintf(xpath, XPATH_MAXLEN,
|
||||||
xpath, XPATH_MAXLEN,
|
"./fast-reroute/level-1/lfa/tiebreaker[index='%s'][type='%s']",
|
||||||
"./fast-reroute/level-1/lfa/tiebreaker[index='%s']",
|
index_str, type);
|
||||||
index_str);
|
|
||||||
nb_cli_enqueue_change(vty, xpath, NB_OP_DESTROY, NULL);
|
nb_cli_enqueue_change(vty, xpath, NB_OP_DESTROY, NULL);
|
||||||
} else {
|
} else {
|
||||||
snprintf(
|
snprintf(xpath, XPATH_MAXLEN,
|
||||||
xpath, XPATH_MAXLEN,
|
"./fast-reroute/level-1/lfa/tiebreaker[index='%s'][type='%s']/type",
|
||||||
"./fast-reroute/level-1/lfa/tiebreaker[index='%s']/type",
|
index_str, type);
|
||||||
index_str);
|
|
||||||
nb_cli_enqueue_change(vty, xpath, NB_OP_CREATE, type);
|
nb_cli_enqueue_change(vty, xpath, NB_OP_CREATE, type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!level || strmatch(level, "level-2")) {
|
if (!level || strmatch(level, "level-2")) {
|
||||||
if (no) {
|
if (no) {
|
||||||
snprintf(
|
snprintf(xpath, XPATH_MAXLEN,
|
||||||
xpath, XPATH_MAXLEN,
|
"./fast-reroute/level-2/lfa/tiebreaker[index='%s'][type='%s']",
|
||||||
"./fast-reroute/level-2/lfa/tiebreaker[index='%s']",
|
index_str, type);
|
||||||
index_str);
|
|
||||||
nb_cli_enqueue_change(vty, xpath, NB_OP_DESTROY, NULL);
|
nb_cli_enqueue_change(vty, xpath, NB_OP_DESTROY, NULL);
|
||||||
} else {
|
} else {
|
||||||
snprintf(
|
snprintf(xpath, XPATH_MAXLEN,
|
||||||
xpath, XPATH_MAXLEN,
|
"./fast-reroute/level-2/lfa/tiebreaker[index='%s'][type='%s']/type",
|
||||||
"./fast-reroute/level-2/lfa/tiebreaker[index='%s']/type",
|
index_str, type);
|
||||||
index_str);
|
|
||||||
nb_cli_enqueue_change(vty, xpath, NB_OP_CREATE, type);
|
nb_cli_enqueue_change(vty, xpath, NB_OP_CREATE, type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -403,7 +403,7 @@ module frr-isisd {
|
||||||
"Limit backup computation up to the prefix priority.";
|
"Limit backup computation up to the prefix priority.";
|
||||||
}
|
}
|
||||||
list tiebreaker {
|
list tiebreaker {
|
||||||
key "index";
|
key "index type";
|
||||||
unique "type";
|
unique "type";
|
||||||
description
|
description
|
||||||
"Configure tiebreaker for multiple backups.";
|
"Configure tiebreaker for multiple backups.";
|
||||||
|
|
Loading…
Reference in a new issue