]> git.puffer.fish Git - matthieu/frr.git/commit
ospf6d: break early on route prefix mismatch
authorPat Ruddy <pat@voltanet.io>
Wed, 19 May 2021 11:11:03 +0000 (12:11 +0100)
committerPat Ruddy <pat@voltanet.io>
Tue, 20 Jul 2021 10:19:48 +0000 (11:19 +0100)
commit0c7f982a383ff4a8baede943ed3095b8813de977
treed68a30ff4d8b8fd6a2bdc79632769de57ea46c3f
parent1dce93dabb078a02cf11c229fa67881fa101d463
ospf6d: break early on route prefix mismatch

The route linked list in ospf6d is ordered in prefix batches which
are associated with a the route node denoting the prefix. So if
you look up the prefix in the tree and start walking the list, if you
find a prefix which differs from the one you are interested in then
you have gone beyond the batch of routes for that prefix.

In some cases the route database linked list is used on a per-prefix
basis. The existing code simply does a continue when the prefix does
not match and continues to walk. This works with small numbers of
routes because the walk continues through unrelated prefix batches and
never finds anything to operate on. However if we have many thousands
of routes these walks become expensive and can cause the SPF thread
(amongst others) to run very long, causing issues with adjacencies
where the dead timer is short.

Add a break to these prefix-based loops to exit early if we get a
prefix mismatch to avoid continuing down the route list if we have
overshot.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
ospf6d/ospf6_abr.c
ospf6d/ospf6_asbr.c
ospf6d/ospf6_intra.c