Skip to content

Commit

Permalink
Merge pull request #18254 from LabNConsulting/aceelindem/ospf6-abr-ca…
Browse files Browse the repository at this point in the history
…lc-addr-sanity

ospf6d: Fix use after free of router in OSPFv3 ABR route calculation.
  • Loading branch information
donaldsharp authored Feb 26, 2025
2 parents 62c0f3a + 06af50e commit 598eaf3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ospf6d/ospf6_intra.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 598eaf3

Please sign in to comment.