Skip to content

Commit

Permalink
Merge pull request #13658 from louis-6wind/fix-flex-algo2
Browse files Browse the repository at this point in the history
isisd: fix wrongly disabled flex-algorithm
  • Loading branch information
donaldsharp authored Jun 5, 2023
2 parents b107092 + 5f23054 commit 05cb9e5
Show file tree
Hide file tree
Showing 2 changed files with 130 additions and 68 deletions.
28 changes: 21 additions & 7 deletions isisd/isis_spf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1843,6 +1843,9 @@ void isis_run_spf(struct isis_spftree *spftree)
struct timeval time_end;
struct isis_mt_router_info *mt_router_info;
uint16_t mtid = 0;
#ifndef FABRICD
bool flex_algo_enabled;
#endif /* ifndef FABRICD */

/* Get time that can't roll backwards. */
monotime(&time_start);
Expand Down Expand Up @@ -1885,16 +1888,27 @@ void isis_run_spf(struct isis_spftree *spftree)
* not supported by the node, it MUST stop participating in such
* Flexible-Algorithm.
*/
if (flex_algo_id_valid(spftree->algorithm) &&
!flex_algo_get_state(spftree->area->flex_algos,
spftree->algorithm)) {
if (!CHECK_FLAG(spftree->flags, F_SPFTREE_DISABLED)) {
isis_spftree_clear(spftree);
SET_FLAG(spftree->flags, F_SPFTREE_DISABLED);
if (flex_algo_id_valid(spftree->algorithm)) {
flex_algo_enabled = isis_flex_algo_elected_supported(
spftree->algorithm, spftree->area);
if (flex_algo_enabled !=
flex_algo_get_state(spftree->area->flex_algos,
spftree->algorithm)) {
/* actual state is inconsistent with local LSP */
lsp_regenerate_schedule(spftree->area,
spftree->area->is_type, 0);
goto out;
}
if (!flex_algo_enabled) {
if (!CHECK_FLAG(spftree->flags, F_SPFTREE_DISABLED)) {
isis_spftree_clear(spftree);
SET_FLAG(spftree->flags, F_SPFTREE_DISABLED);
lsp_regenerate_schedule(spftree->area,
spftree->area->is_type,
0);
}
goto out;
}
goto out;
}
#endif /* ifndef FABRICD */

Expand Down
Loading

0 comments on commit 05cb9e5

Please sign in to comment.