diff options
author | Olivier Dugeon <olivier.dugeon@orange.com> | 2024-11-23 18:50:21 +0100 |
---|---|---|
committer | Olivier Dugeon <olivier.dugeon@orange.com> | 2024-11-23 19:05:25 +0100 |
commit | 1bcccb87cdc5de9dfe0573c0b2faf57d7043ac17 (patch) | |
tree | 65d5ee6e66177003d4c717fdee889c3236865ccd /ospfd | |
parent | Merge pull request #17459 from opensourcerouting/fix/disable_rpki_community_b... (diff) | |
download | frr-1bcccb87cdc5de9dfe0573c0b2faf57d7043ac17.tar.xz frr-1bcccb87cdc5de9dfe0573c0b2faf57d7043ac17.zip |
ospfd: Correct invalid SR-MPLS output label
When OSPFd starts, there is 2 possible scenarios for Segment Routing:
1/ Routes associated to Prefixes are not yet available i.e. Segment Routing LSA
are received before LSA Type 1. In this case, the function
ospf_sr_nhlfe_update() is triggered when a new SPF is launch. Thus, neighbors
and output label are always synchronise with the routing table.
2/ Routes are already available i.e. LSA Type 1 are received before Segment
Routing LSA, in particular the Router Information which contains the SRGB.
During nhlfe computation, perfixes are leave with incomplete configuration, in
particular, the SR nexthop is set to NULL. If this scenario is handle through
the function update_out_nhlfe (triggered when SRGB is received or modified from
a neighbor node), the output label is not correctly configured as the nexthop
SR node associated to the prefix has been leave to NULL.
This patch correct this problem by calling the function compute_nhlfe() when
the nexthop SR Node associated to the prefix is NULL within the
update_out_nhlfe() function. Thus, we guarantee that the SR prefix is always
correctly configuration indpedently of the scenario i.e. arrival of the
different LSA.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Diffstat (limited to 'ospfd')
-rw-r--r-- | ospfd/ospf_sr.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ospfd/ospf_sr.c b/ospfd/ospf_sr.c index 97dc57867..89db97922 100644 --- a/ospfd/ospf_sr.c +++ b/ospfd/ospf_sr.c @@ -1334,6 +1334,12 @@ static void update_out_nhlfe(struct hash_bucket *bucket, void *args) continue; for (ALL_LIST_ELEMENTS_RO(srp->route->paths, pnode, path)) { + /* Compute NHFLE if path has not been initialized */ + if (!path->srni.nexthop) { + compute_prefix_nhlfe(srp); + continue; + } + /* Skip path that has not next SR-Node as nexthop */ if (path->srni.nexthop != srnext) continue; |