summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJafar Al-Gharaibeh <jafar@atcorp.com>2025-03-01 15:02:53 -0600
committerGitHub <noreply@github.com>2025-03-01 15:02:53 -0600
commita4a3926582860dd684917b065738c512a25eca02 (patch)
treecfa94ba4faa670186eb7c3690d94fb44be567504
parent13b386b65795f1b79968e251365e870e1309734d (diff)
parent2a22f2cd8cb8e27f15e8edd5f7dde4349a2970b4 (diff)
Merge pull request #18265 from FRRouting/mergify/bp/dev/10.3/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 4765c29e1e..da67c4ed67 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)