Skip to content

Commit

Permalink
isisd: Fix infinity flag not being set successfully
Browse files Browse the repository at this point in the history
When creating SPF neighbors and calling spf_adj_list_parse_tlv(), the F_ISIS_SPF_ADJ_METRIC_INFINITY flag is only set to a local variable flags and not set to the SPF neighbor sadj->flags. Additionally, the pseudo node metric pseudo_metric is also not reflected in the F_ISIS_SPF_ADJ_METRIC_INFINITY flag, the metric should be checked using sadj->metric.

Signed-off-by: zhou-run <zhou.run@h3c.com>
  • Loading branch information
zhou-run authored Sep 21, 2024
1 parent 916c90f commit dd40335
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions isisd/isis_spf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1469,14 +1469,13 @@ static void spf_adj_list_parse_tlv(struct isis_spftree *spftree,
sadj->metric = metric;
if (oldmetric)
SET_FLAG(flags, F_ISIS_SPF_ADJ_OLDMETRIC);
if ((oldmetric && sadj->metric == ISIS_NARROW_METRIC_INFINITY)
|| (!oldmetric && sadj->metric == ISIS_WIDE_METRIC_INFINITY))
SET_FLAG(flags, F_ISIS_SPF_ADJ_METRIC_INFINITY);
sadj->lsp = lsp;
sadj->subtlvs = subtlvs;
sadj->flags = flags;

if ((oldmetric && metric == ISIS_NARROW_METRIC_INFINITY)
|| (!oldmetric && metric == ISIS_WIDE_METRIC_INFINITY))
SET_FLAG(flags, F_ISIS_SPF_ADJ_METRIC_INFINITY);

/* Set real adjacency. */
if (!CHECK_FLAG(spftree->flags, F_SPFTREE_NO_ADJACENCIES)
&& !LSP_PSEUDO_ID(id)) {
Expand Down

0 comments on commit dd40335

Please sign in to comment.