Merge pull request #18254 from LabNConsulting/aceelindem/ospf6-abr-calc-addr-sanity

ospf6d: Fix use after free of router in OSPFv3 ABR route calculation.
This commit is contained in:
Donald Sharp 2025-02-26 12:47:57 -05:00 committed by GitHub
commit 598eaf37f8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2194,9 +2194,15 @@ void ospf6_intra_brouter_calculation(struct ospf6_area *oa)
zlog_info("%s: brouter %s appears via area %s",
__func__, brouter_name, oa->name);
ospf6_route_lock(brouter);
/* newly added */
if (hook_add)
(*hook_add)(brouter);
if (CHECK_FLAG(brouter->flag, OSPF6_ROUTE_WAS_REMOVED)) {
ospf6_route_unlock(brouter);
brouter = NULL;
} else
ospf6_route_unlock(brouter);
} else {
if (IS_OSPF6_DEBUG_BROUTER_SPECIFIC_ROUTER_ID(
brouter_id)