From fa42b7d80f0348d4216909c2e94068a15bf6774b Mon Sep 17 00:00:00 2001 From: Igor Ryzhov Date: Thu, 25 Nov 2021 21:17:58 +0300 Subject: [PATCH] ospfd: fix summary-address deletion When the summary-address is deleted, `ospf_aggr_handle_external_info` is called for each aggregated route for the cleanup. It needs to find the corresponding OSPF instance and it does it using the `ei->instance` which is totally wrong, because it's the instance from which the route is redistributed, not the local OSPF instance. A pointer to the correct OSPF instance is already stored in the external_info structure. Signed-off-by: Igor Ryzhov --- ospfd/ospf_asbr.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ospfd/ospf_asbr.c b/ospfd/ospf_asbr.c index 982fad63ec..000c62e305 100644 --- a/ospfd/ospf_asbr.c +++ b/ospfd/ospf_asbr.c @@ -420,7 +420,7 @@ static void ospf_aggr_handle_external_info(void *data) { struct external_info *ei = (struct external_info *)data; struct ospf_external_aggr_rt *aggr = NULL; - struct ospf *ospf = NULL; + struct ospf *ospf = ei->ospf; struct ospf_lsa *lsa = NULL; ei->aggr_route = NULL; @@ -431,8 +431,6 @@ static void ospf_aggr_handle_external_info(void *data) zlog_debug("%s: Handle extrenal route(%pI4/%d)", __func__, &ei->p.prefix, ei->p.prefixlen); - ospf = ospf_lookup_instance(ei->instance); - assert(ospf); if (!ospf_redistribute_check(ospf, ei, NULL))