summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJafar Al-Gharaibeh <jafar@atcorp.com>2025-02-27 10:12:52 -0600
committerGitHub <noreply@github.com>2025-02-27 10:12:52 -0600
commit8f85bc932abe669faf7230d0fc194dec9b9b8509 (patch)
treea323182bd05a413d389544fe9594bcc6aaf7859c
parentb26f7fba928bc1291d5a97774efe1f6d898c9f6e (diff)
parent0d7236c2d279d95a83e71ead532ee86b9e0d9fe8 (diff)
Merge pull request #18266 from FRRouting/mergify/bp/stable/10.2/pr-18254
ospf6d: Fix use after free of router in OSPFv3 ABR route calculation. (backport #18254)
-rw-r--r--ospf6d/ospf6_intra.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ospf6d/ospf6_intra.c b/ospf6d/ospf6_intra.c
index 324cd7abe8..23a5ec0695 100644
--- a/ospf6d/ospf6_intra.c
+++ b/ospf6d/ospf6_intra.c
@@ -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)