HomeFreeBSD

[multipath][nhops] Fix random crashes with high route churn rate.

Description

[multipath][nhops] Fix random crashes with high route churn rate.

When certain multipath route begins flapping really fast, it may
result in creating multiple identical nexthop groups. The code
responsible for unlinking unused nexthop groups had an implicit
assumption that there could be only one nexthop group for the
same combination of nexthops with weights. This assumption resulted
in always unlinking the first "identical" group, instead of the
desired one. Such action, in turn, produced a used-but-unlinked
nhg along with freed-and-linked nhg, ending up in random crashes.

Similarly, it is possible that multiple identical nexthops gets
created in the case of high route churn, resulting in the same
problem when deleting one of such nexthops.

Fix by matching the nexthop/nexhop group pointer when deleting the item.

Reported by: avg
(cherry picked from commit 054948bd81bb9e4e32449cf351b62e501b8831ff)

Details

Provenance
melifaroAuthored on Aug 1 2021, 9:46 AM
Parents
rG72a8cdd3226e: build.7: Describe the default value for LOCAL_MODULES
Branches
Unknown
Tags
Unknown